JavaScript updateable priority queue, via a min-heap and reverse map from values to keys