Misc test framework refactoring.