HTTPSock: gzip compression for text files and HTML responses

I have been working on some additional web functionality for ZNC when I noticed that HTTP responses (JS and CSS files, HTML content) are not being compressed by ZNC. This is a patch to change that.

Please let me know what you think. There may some stylistic issues in the code, too. Also, it's dealing with buffers, so I'd appreciate if everyone could double proof-read the new code.