Allow user to exit without saving
In MainWindow, right now if the user closes the window via the system close command, MainWindow will close without saving the document. It's desirable to be able to do this, but the user should be warned if they do this; otherwise they will potentially lose lots of work.
We'd also like the user to be able to exit without saving via the File menu. This should execute the same code that clicking on the system close button does, so that we handle both of these cases uniformly.