Move all application exit points to the main function. This opens up the possibility of testing other classes.