Merged in rhaas/reduce_io (pull request #5)
this reduces file open/close calls to be only once per output cycle per file and not once per mode
this reduces file open/close calls to be only once per output cycle per file and not once per mode