Fixing misc todo's & added unit test for bitstream