main_nogui: finish re-factoring main loop into functions
re-factor main loop into separate library
main.cpp: re-factor to use common main loop setup
CMakeLists: link common libraries into common
CMakeLists: document targets
mainloop: re-factor CHECK_RC_RETURNING to use std::cerr
Merge pull request #11 from rjw57/main-loop-refactor

Main loop refactor