refactored decoder framework so that multilayer decoding can be done.

Change-Id: I7312d534d02b6fb907c7dc2e679deef8f76995d7
Signed-off-by: Amit Mandke <ammandke@cisco.com>