Refactor query_changes routine

Now it receives a list of options after the list of queries. This is
more flexible because the caller can decide which options should be
passed to Gerrit.