Factor loader into a database storer and a batch loader

I had assumed I would need an error path, but it turned out that I did not. Will remove.