Add gzip compresson to tcp protocol

Additionally a bit more tuning