add support for pluggable compressor/decompressor

Add support for pluggable compressors.

zlib is a fine choice for a default compressor, but in some environments
alternatives (lz4/lzf/snappy) that offer different tradeoffs for
size/time, may be preferred.