Split functionality into two, distinct classes

One (Decoder) for decoding and one (Encoder) for encoding.