Refactor testing environment code to remove Log.php tests hack.