Fix the problem when the declaring class of a public method is non-public

Sometimes, the declaring class of a method (Method.getDeclaringClass())
retrieved through Class.getMethods() for a public class will be a
non-public superclass. For such a method, we need to find a method with
the same name and signature in a public superclass or implemented
interface.

This typically doesn't happen with classes emitted by a reasonably modern
javac, as it'll create synthetic delegator methods in all public
immediate subclasses of the non-public class. We have, however, observed
this in the wild with class files compiled with older javac that doesn't
generate the said synthetic delegators.
Use a Set instead of List for storing nested classes.

Since we're searching in superclasses sometimes now, we need to make sure
we don't put nested classes from a superclass into the list twice.
Aid debugging by adding toString() to MethodSignature class.