Promise polyfill for the browser and node.js