Fix issue when using GZip and refactor using Q.

This pull request fixes an issue when using GZip, making it more consistent and re-zipping the injected content. Also moves to Q instead of async for asynchronous handling.