Add attributes to avl functions

This PR redoes #140
Yes, but in _this case_ we _depend_ on the function accepting `NULL`. READ `regen_metadata`.