Rework main.cpp into MVC design

Still mostly code scaffolding but MVC structure is in place.