Refactor tests, reuse DB creation boilerplate.