Refactor assign_tasks to use get_batch_agent_pair
Refactor assign_tasks to use get_batch_agent_pair

assign_batch_at_prio() has now been renamed to get_batch_agent_pair(),
and instead of directly assigning tasks to an agent at a priority level,
it will return a tuple of a list of tasks and agent they can be assigned
to, leaving the actual assigning to the caller.

This is necessary because assign_tasks will need to queue a
send_tasks_to_agent() task for every agent that has been assigned new
tasks, but it must do that after committing its database transaction. In
the previous architecture, assign_tasks() never actually which agents
exactly where touched.

pyfarm/pyfarm-master,pyfarm/pyfarm-master,pyfarm/pyfarm-master