Implementing stable ordering of query string arrays