Rebuilt the export to CSV script

Including the Tulip perspective