Implemented IndirectCodec and a simple test for it