Change enqueue()/runqueue() to avoid global variables.

Also, change enqueued functions to call done() callbacks instead of using
return values, so that async functions (like http requests) can be used as
steps.

Add some unit tests for enqueue/runqueue.
4 files changed