This code encodes the data into a binary file and writes in the amount of bits based off of the dictionary's size. (i.e. 9 bits for a >256 entry dictionary, 10 bits for a >512 entry dictionary, etc.)
Methods are NOT commented, so what each one does should be listed here