Refactor ExpressionCodegen.invokeFunction() once again

Extract and reuse return type mapping between normal callable methods and
intrinsics
Fix VerifyError for 'when' of type 'Unit?'
1