Compile methods as static methods taking CompilationUnit rather than instance

This means that all methods for which MethodHandles are generated have types
that do not mention dynamically generated types, so the intern table in
MethodType does not indefinitely hold references to our classes (and
indirectly, GlobalContexts and everything in them).