Treap data structure implementation for node.js and the browser