AvlTree: reduced duplication in `get` and `contains`.