Promote higher-order functions using defunctionalization
Support defunctionalization in singletons
Update tests to work with the new testsuite