Fix bugs in + make improvements to tpl-param serialization

This patch fixes the following bugs and edge cases in
serialization of transclusion params.

1. Fixes RTing of {{echo|1=x}} vs. {{echo|x}}.  So far, both
   versions would RT back to {{echo|x}} -- I've seen this happen
   a couple times in production diffs as well.  This patch
   fixes the RTing of the first snippet by recording an additional
   'named: true' flag in the data-parsoid param info object
   and using it during serialization.

2. PHP parser does not strip WS for positional params.  Parsoid used
   to strip trailing WS for positional params, but we decided to
   replicate PHP behavior to minimize confusion especially since we
   use PHP preprocessor for expanding transclusions.

   Consolidated existing tests into new tests for this behavior.
   The positional param ws-stripping test still fails wt2html
   because of unrelated bugs where some whitespace is being lost
   in our transforms for snippets like this: "{{echo| }}a".
   Will be investigated separately.

3. This patch also fixes another known bug in production.  Consider
   the following wikitext:

{{quote
|sign=
|text=This is a quote
}}

  If you edit this template in VE to add a value for the 'sign'
  param to say 'bar', Parsoid would then serialize this to:

{{quote
|sign=
bar|text=This is a quote
}}

  For empty param values, the newline after "sign=" was treated as
  a newline *before* an empty value instead of a newlined *after*
  an empty value. On serialization, this led to the newline being
  output before "bar".

  NOTE that for param-keys, the existing behavior is correct.

  - This patch fixes this bug which in turn fixes the post-edit
    serialization of the above snippet.

  - We have to figure out a way of testing this behavior.

    Since WS-info is part of data-parsoid, we cannot test this
    without adding data-parsoid to parser tests.
    Is this the best solution?  To be figured out.

Change-Id: I8a9609520a1af4fabe18c423378870edf2922482
Merge "Fix bugs in + make improvements to tpl-param serialization"