Further refactoring of tests.
Merge.