Support callback return types in codegen

This change gets used for the getter function of TreeWalker.filter, which returns a NodeFilter, which is a callback interface.