Greatly improved the performance of huffman-encode. The encode function can now take an optional map to use and will warn (and not encode) values that aren't found in the map.