Factor loader into a database storer and a batch loader

the tables are out of order in this example. `pending_load.batch_id` references `load_batch`, I mention this only so that its not an annoyance to someone getting started on this project.