Port: Codec, CodecUtil, some cleanup