Add encode/decode to huffman codec.