Miscellaneous cleanup and stop crashing on weird map sizes.
More cleanup
More cleanup
More cleanup
Add save_to_csv for layers
Add rudimentary exporting features