Small refactoring

Hello there!

I started using your distribution and think I can help improving it a bit. In this pull request I did:

* Removed usage of goto while maintaining the same logic.
* Replaced system(gzip) with IO::Compress::Gzip and File::Spec to allow the distribution to run in other OS than UNIX-like ones. These should be core modules for any modern perl.
* Added some tests names to write.t

All tests are passing but I noticed that there is no test for file compression. I can help creating one if you're OK with the suggestions.