use StringIO in LZW to make it not O(N^2)
Merge pull request #4311 from dimagi/fix-compress

use StringIO in LZW to make it not O(N^2)