Reduce CMake code duplication and conflicts with CmdStan, start unit testing CmdStan with CMake.