LZW decompression algorithm reimplementation

Fixes some rendering bugs.
Greatly improved performance.