Add query interface and test harness.