Change so MainWindow handles its own deletion, and deletion of other UI objects to allow for closing when the MainWindow is closed, regardless of if other windows are open.