Simple MainWindow Unit Test

Added initial MainWindow Unit Test. Just creates, shows, closes window. Also additional related changes with details in commit comments.