add tests (and fix a couple bugs!)

Also, jobs can now leave off the 'action' property (it defaults to a
no-op).