Use defineProperties to extend Promise.

Fixes a “TypeError: Promise is not a promise” error in Chrome and Firefox.