Adding _.getQuery() and corresponding tests