Further clean-up for runtest. First implementation of runtest.R