Heap data structure for node.js