Add support for an advanced task scheduler managed by the application.

It might be worth adding an async version of the suspend/resume test.