Factor loader into a database storer and a batch loader

this seems to be a perfect fit for the init function