Move some test routines into 'tests'