added better support for avl tree nodes

Added more support for using AVL tree root structures instead of raw node
pointers.