zlib port to javascript, works in browser & node.js