Remove superfluous str call in test
result-size hasn't been used in a while
Factor out the state creation logic

And then the rest of it turns into a doto. Super elegant.
Allow resuming a computation that had unfinished jobs.
Clean up comments and write a few docstrings