Zlib output buffer is now allocated on the heap.
Added internal zlib library.