replace hash map with optimized data structure to avoid excessice allocations
fix some bugs
Some cleanup
Merge pull request #219 from nwin/speed_up_lzw

Speed up lzw