Support local testing.
Major rewrite.

That is:

  - prettier code
  - less useless polling

The scheduler is now based on callbacks only and doesn't run in a
separate thread. Files are still copied to and from scratch after every
job.
Fix example workflow.