data structure AVLTree implemented in javascript