Added ability to compress the output file. Added support for multiple file types.