Define type instances without wrapper function

All test cases are passing, and test-everything is no more broken than without, but this probably isn't ready yet. Certain types of recursive definitions between instances may not work, but I haven't yet thought of any that weren't already broken by #365.

This required sorting binding groups by their immediate dependencies (those not wrapped in function bodies).  This is not perfect, as those functions may be evaluated immediately, but in any generated instance declarations they are not.
Well, maybe it makes more sense to deal with it here. The only advantage I see of doing it in the typechecker is that the typechecker handles multiple errors, but this module doesn't yet. On the other hand, fixing it here could make issues like #365 easier to solve, I'm not sure.