Reduce memory use by flushing buffers and periodically closing the zipfile
Merge pull request #21 from ghelleks/oom-errors

Reduce memory use, props @ghelleks.