Added option to set the data logger output file.
Cleaned code up a bit.