BacklinkCache performance tweaks

* In partition(), avoid doing the JOIN since it is not needed and prevents
  index-only queries.
* Made numLinks() wrap partition when no $max is specified.
* Also fixed some docs

Change-Id: I05a83f71efb4c6e99e40883d7fa53da59184b13c
Merge "BacklinkCache performance tweaks"