Make _to_query an instance method rather than a class method.

I followed the blame tree, and the reasoning I gave for making it a class method makes no sense. Several other routines are just as state-independent as this one, and I want them all to be consistent. I don't really care which way they are. I'm picking instance.