This is the same idea, but with ZSTD instead of ZLIB. I've kept the zlib code since we require zlib, but zstd is optional.