Make asap work in browsers as well as node.