Change-Id: Ia29ce678c0e64e886cdd92bbfda727768356fd21
Did some re-factoring to share code with upcoming (multi stream) packager. Change-Id: I2b3845e48ba6aa63a95ecc276abcb52c8355d8d5