Clean up how batches/store handles database.DB
Created by: mrnugget
This is a follow-up to some of the refactoring work that @camdencheek has been doing.
It adds a new (*store).DatabaseDB() database.DB
helper and uses it
whereever possible to get rid of some nested calls.
It also refactors some tests to use the new mock stores.