LZW compression in component form, from https://github.com/pieroxy/lz-string