Force promise rejection values to be Error objects.
Move towards the standard promise API

Promise is no longer an abstract class and its constructor takes a
resolver function. Deferred is no longer an instanceof Promise, but it
still (temporarily) implements Thenable for API backwards compatibility.