Implement avl_union

This PR adds the `avl_union` function and it's implementation.
I would like to see a list what error numbers on what kind of error, as I do in #247