Clean up function calling code
We should migrate most of our code to using GClosure
as it would help us cleanup/abstract things a lot better.
We will need a few types likely:
- TmplGIClosure which can call GI functions using TmplExpr params w/ appropriate marshalling
- TmplBuiltinClosure which can be more simple, convert the single param allowed for builtin's into a call to a builtin. Perhaps doing this could be a way for us to move past a single builtin param so we can do more interesting things.
- TmplUserFnClosure to call user defined functions with the various TmplExpr parameters
And with that in place, we should be able to vastly simplify the user function calling code in tmpl-expr-eval.c
. Additionally, we should start caching closures so we don't have to create them every call.