Support TLS and compression at the same time

* Support TLS with snappy or deflate
* Refactored integration tests