Deferred: produce and consume standard thenables

Up-to-date version of the patch that passes all the tests.