Some error handling in main.cpp
Also spruced up the threading a bit, and started on a command input on the main thread.