Move main function out into main.cpp