Modernize respond_to implementations

Since at least Ruby 1.8.7, `respond_to?` has supported an optional
second parameter which causes private/protected methods to be included
in the check. This defaults to false.

As of Ruby 2, there's a warning logged if an implementation of
`respond_to` does not take a second parameter, see:
https://github.com/ruby/ruby/commit/a106b310e5bbe678022b127b9d32bb0a55708002

This change updated the respond_to implementations to support the second
parameter and squelch this warning.