Fix for invoking closure pointers

This fixes codegen for calling closure pointers, which removes the need for an annoying workaround.  In the process of writing tests, noticed that the type recognition system in the parser wasn't good enough.  This makes it a lot better too.
Merge branch 'bug/closure-pointers'