Refactoring

Move Window creation from main to Window struct. This means sane
unittests.