(Bug 52824) Improved handling of '=' char in tpl-param values

* Presence of the '=' char in the wikitext value of a tpl-param
  is insufficient to determine whether it will be nowiki escaped.

  Ex: In {{echo|{{echo|1=foo}}}}, the first arg of the outermost
  param does have the '=' char in the wt, but it doesn't need to
  be nowiki escaped nevertheless (nor converted into a named
  parameter).

  This patch moves the decision for whether to convert a positional
  param (with a '=' char in its wikitext) to a named param to the
  wikitext escaping code where this decision can be made more
  precisely.

  This is the bug reported in 52824

* In addition, this patch also adds a heuristic to determine when
  to nowiki-escape a positional param with a '=' char and when to
  convert it to a named param.  Because of the idiosyncracies of
  positional and named params, converting a positional param to
  a named param usually forces all later positional params to be
  converted to named params as well which then introduced a lot of
  dirty diffs, and also makes it quite painful to maintain the
  transclusion wikitext.

* Added/updated existing parser tests.

  NOTE: Without adding data-parsoid to parser tests, it is not
  possible to test the heuristic bit of this patch.  This is one
  more case where info in data-parsoid is essential to test some
  of Parsoid's serialization features.

Change-Id: I8d2277e4d931a934c29ec5a61985d159c2537217