Job state machine

Each job is a document. The backend claims it, does the work, and a sweep picks up anything that stalls.

modestatusattemptsoutputcreatedclaimeddoneid