tests added for complex queries
simplequery.js updated to pass tests