Implement Huffman Encoding and Decoding

This version has to be tuned for memory efficency