Fix translation of JS SAMs when they are nested in other lambdas.

The class defs appearing as the result of SAMming js.FunctionN and
js.ThisFunctionN must be handled before class defs that
instantiate them. In this commit, we always first handle these,
then class defs for Scala lambdas, then other classes.