Add avl utilities

This PR introces a few utilities for use in recursive algorithms like `avl_union()`.
The copyright header show be on top of the file.