Replaced node's `zlib` call to js implementation for browser compatibility