Moving testing of user submitted code into it's own function.