A javascript heap implementation