Extensive cleanup and simplification of tests.