Implement codec classes

Nit: I would make this *private*, like the equivalent in *DataDecoder*.