Factor loader into a database storer and a batch loader

ok so lets list the states that we have here:
1. handle completed loads
2. handle stale loads
3. insert new loads

fundamentally this function is doing two things: providing synchronization around the messagesInFlight variable and managing the stale retry logic. Maybe it is worth separating those concerns? the messagesInFlight seem like a good use case for a WaitGroup, while the retry logic could be handled here.