Move some testing functions to a misc. module.