Beginning of main window

Also whitespace/formatting updates