Prefer String#slice over substr() or substring()

* String#substr and String#substring both exist but have
  different signatures which are easily mixed up.

  String.prototype.substr( start [, length] )
  > Supports negative start, but not in IE8 and below.
  > Takes length, *not* second index. E.g. `substr( 2, 3 )`
    returns `slice( 2, 5 )`.

  String.prototype.substring( indexA [, indexB] )
  > Doesn't support negative indices.
  > If indexA is larger than indexB, they are silently swapped!

  String.prototype.slice( start [, end] )
  > Supports negative indices.

* String#slice works like Array#slice and slice methods
  elsewhere (jQuery, PHP, ..).

See also
* https://www.mediawiki.org/wiki/CC/JS?oldid=1133318#Pitfalls
* I9b6dd682a64fa28c7 in mediawiki-core.

Change-Id: I221ef6ae6956ce20dd9bb74510500f747d04c3b1