Parse Accept-Encoding: headers and send compressed data.

Also use correct MIME types for Javascript and JSON.