updates to v2 of api

OK!
sitting in a conference being held in language i don't understand, so i had some free time...
here's a first pass at updating to the new api. had to move some things around a little..a lot in the test_query.rb, which is still a bit of a mess. but does this look like it's going in the right direction? thx, c.