templated avl tree