Some MVP reorganization and cleanup. Created AppFactory.