AVL tree in JavaScript