Functions can now implement ResultTypeQueryable to supply TypeInformation manually.

Implements #845.