Refactor encoding of huffman strings
Check return value of huffman_decode