Fix singletonizing of higher-order functions

We now correctly generate Proxy parameters and calls to Apply for
higher order functions that take higher order functions.