Put the prevention of only-ones-code into separate function. Putting it into package_merge would break tests etc, isn't really a part of package merge anyway.
Removed obsolete huffman tree generation and related stuff.