DOM promises for browsers and node.js