Moved Chai/C++ switcher out of header files to limit recompilations