Export functionality

I'm starting to work on making exporting happen. Not at all ready to merge - I'm just curious what you think.
I'd move everything export-related.

You could even have a separate class that implements the dialog, and one that takes action based on the result of the dialog. That kind of decoupling is good in general.