Hacked together some gzip encoding stuff.