[WIP] Support multiple simultaneous tasks.

This is part of the work necessary so that a single server can support multiple simultaneous tasks. The work isn't done, but wanted to PR for feedback.