Update testrun.cc

Moving small functions to associated file, bringing in line with design doc