New module to replace TmpFile
Added transparent handling of gzipped files
Tidying up
Fleshed out write methods and did a bit more tidying