Added native deflate

Added native deflate and changed the api to work with callbacks