Adding map export

This adds a mostly-functional map export to csv.php. One known issue will shortly be added to the issue queue.