Check for and switch to client mode as the very first thing in main to better simulate it running standalone.