Cleanup app and mainwindow

Hmm, have you tested this in every scenario? I recall I did this because when you start the app in standalone mode, something doesn't get set right, so certain files are looked in the wrong places.