Convert run-tests and run-all-tests to functions.