Applying Huffman compression algorithm

This javascript program turns text into bits using huffman encoding compression.
Note that the bits also include the Huffman table encoded in bits at the beginning