Factor loader into a database storer and a batch loader

I think its worth while to use a flagenv style here. configs should be able to be provided via env, cmdline or config file.