Add CodecSpec for declarative creation of encoders/decoders.