Rewrite the convoluted get_work() function to be much simpler and roll work as much as possible with each new work item.