new tests for query building, closes #13