Completely reworked function application rule.

Behaves much better with various subtyping cases.