Quit when the main window is closed.
Removed some code that wouldn't link
Fixed a bug with the tabs never getting added and quit on last tab