Abstract out the main hashing loop to allow us to use a separate loop for devices that are fast enough to require queued work.