Cleaning up huffman coder and adding error detection and a better estimate of buffer size required for encoding.
Revert "Cleaning up huffman coder and adding error detection and a better estimate of buffer size required for encoding."

This reverts commit 1509bad21831af876047851a7a810ec36472eb41.
Adding only the intended file...
Cleanups and better error handling for Huffman encoder.