added query_interface class

Not totally certain what you wanted me to do, but here's a new class anyway.