Add gzip support

The sendTar function has been slightly refactored for the sake of
allowing tar.gz downloads.