Fix and rewrite PageGenerator's query string

The old code has a flaw when, for example, iiprop is in kwargs. Instead of
"xxx|timestamp|...", the query string will be "xxxtimestamp|..."
which is wrong. This patch fixes the problem and remove redundancy
of the code.

Change-Id: I7d496a612d32c70ccb53d2cdcf95cc036944d808
Merge "Fix and rewrite PageGenerator's query string"