Add attributes to avl functions

This PR redoes #140
But if the function has a `NULL` check _by design_ (because it is used in recursive algos) it's bogous to add the `nonnull` attribute.
The thing is: attributes are also a form of annotation/documentation. If a function has a `NULL`-check, it shouldn't be attributed with `nonnull`.