Introducing the StreamingCodec interface

Also includes some clean up and some utils