added a sorting enumeration for ordered iteration

Added a sort enumerator for generating ordered iteration objects. Added a
function for obtaining an iterator from an AVL tree whose lifetime is tied to
the iterator.