Removed zlib
Added var to a few variable to avoid globals and removed the use of Event emitter