Get the date and time functions the right way around.
Bring the field name canonicalisation function out into its own utility function.
Add two new CSV functions:

* getRecordCSV
* cleanCSV

and unit tests for them.