Gui: Split mainwindow into mainwindow and simulationthread. Add quit event for gui