Avoid calling define_method in CollectionProxy#scope

Calling define_method busts the method cache, which has a major performance penalty. This refactoring avoids that in CollectionProxy#scope.