Reimplemented AVLTree to work with timespans.