Create MainApp correctly

Inital commit with new mainapp.