Avoid the page join when not really needed

* That sometimes triggered a filesorts when the title for the
  inequality has certain (seemingly long) values.
* Also made the continuation queries use > instead of >=.

Change-Id: I912df77ad43f025918e52d1494300d487a9deea1
Special:ExpandTemplates: Use MediaWiki UI

Bug: 71433
Change-Id: Ibe965741734bb911813084dad132ece179cc0362
Merge "Avoid the page join when not really needed"
Merge "Special:ExpandTemplates: Use MediaWiki UI"