Use a thread to store the worker's progress
Fix the tests and some race conditions
Set the locked_by column
Lock jobs where the worker has died
Various bug fixes
Code cleanup