Externalize `any_instance` methods and state like we did mock proxies.

This is similar to #250, but doing a similar refactoring for `any_instance`.
Merge pull request #265 from rspec/refactor_any_instance

Externalize `any_instance` methods and state like we did mock proxies.