this is an attempt at directly implementing the dom promise spec at http://dom.spec.whatwg.org/#promises it doesn't work yet.