Added CSV file writing capability

We still need a command line flag for this