db test cleanup part 1

more minor refactoring, gets rid of some calls to `instance_eval` in the test suite