Change custom functions to use tree.Anonymous instead of our own type