Adding --to-csv option to export datasets