Enhance performance

Instead of calling Module#public_instance_methods (twice), and iterating
over the instantiated array (twice), simply call Module#public_method_defined?.