Beginning the final re-write of xbmain.cpp.
Currently the testing branch is broken and will not compile. The makefile needs updating as well.