if filename ends in .gz, wrap output in a gzip.Writer
preprocess filename through a template
file writer is a type with an internal buffered writer
autorotate every time.Duration
added max file size before rotation
fixed race condition.  Close on BufferedWriter now doesn't return until underlying writer is closed, ensuring a proper flush before the app exits
added random int to file writer template
flush before closing
Merge branch 'improved_file_writer'