Implement avl_union

This PR adds the `avl_union` function and it's implementation.