Updates file data writer so it writes csv files rather than json

All this code is currently specific to the balloon, so I've moved it into
that project. Adds unit tests for the new data writing functionality.