Add support for waiting for futures in continuations.
Add tests for continuations and futures.