Use a less memory intensive batch upload algo

Do a bunch of lookups when sending data out to be
uploaded to S3, instead of doing one big bulk
query and running out of memory