Improving huffman

Add a new state machine to represent internal tree nodes.