Renamed -i flag to -d
Use .csv extension for temporary CSV files
Added CSV export program. The code is there anyway, might as well use it.