Fix #26. Add new version of put() which allows you to specify the compression parameters.

Also tidy up the outputstream handling.