Merge UDF code with existing function code
Prefer exact type match when resolving functions
Update tests