TR: better checking for applications of unioned functions/objects

The commits I'd like to get reviewed are mainly the last two. They implement support for better checking for applications of unioned functions or unioned objects (with method send).

Instead of crashing with an internal error, TR should now union the results of the function call correctly. If the number of return values are not consistent, it will lift the result to `AnyValues` conservatively. Otherwise it will pointwise union if there are multiple values.

The main concern I have is this: should the `union-results` function error instead of lifting to `AnyValues`? Also let me know if the union logic seems bogus. It could also be smarter about filters, but that can be added later.