Refactor tests

Does quite a bit of pruning of obsolete tests, and minor updates to existing tests.