Take #2: (Bug 50841) Reduce scope of nowiki tags

* This does a more thorough job of reducing scope of nowiki tags
  even if it is a tad more expensive to do.  Given that serialization
  is not that expensive overall, and only a small fraction of tests
  even qualify for the 'escapedText' routine, this is not a real
  concern.

* Updated expected output (=test input) for a number of tests to
  reflect the new nowiki scoping + regenerated selser changes.

* Four additional tests now fail
  1. "<nowiki> unordered list" in html2wt mode
     - because the HTML for html2wt comes from the php version which
       does not have Parsoid-specific types required for accurate
       html2wt-ing.  As a result, the HTML is treated as "new HTML"
       and the nowiki is applied to a smaller string than the input

  2. "<nowiki> spacing" in html2html mode
     - for similar reasons as 1. above

  3. "1. Leading whitespace in SOL context should be escaped" in html2wt mode
     - Because on retokenizing, tabs are converted to spaces by the
       indent-pre productions (known issue with tokenizer).  It is
       unclear if this is a big problem.  If tokenizer can preserve
       tabs in indent-pre position, this bug will go away.

  4. "Links 1. Quote marks in link text" in selser mode with changes [[[4,3]]]
     - Seems unrelated to the patch since the input has no
       escapable characters.  This is just a failure triggered
       by a new selser changes input that would have failed anyway.

* These are tests and new output from the tests documented in the commit
  message of commit 83db891f1 which was a previous attempt at this bug.
  One test has been slightly modified.

------------
[subbu@earth lib] echo "Links in wikitext are written like this: [[foo]] How magical\!\!" | node parse --html2wt

Links in wikitext are written like this: <nowiki>[[foo]]</nowiki> How magical!!
------------
[subbu@earth lib] echo 'Hello my [[name]]*(see below) is Julian and I live in the city of Rochester, New York\nwith my friend Sandy; we write [[books]].' | node parse --html2wt

Hello my <nowiki>[[name]]</nowiki>*(see below) is Julian and I live in the city
of Rochester, New York with my friend Sandy; we write <nowiki>[[books]]</nowiki>.
------------
[subbu@earth lib] echo 'Hello my [[name]]*(see below) is Julian and I live in the city of Rochester, New York to \n* escape with my friend Sandy; we write [[books]].' | node parse --html2wt

Hello my <nowiki>[[name]]</nowiki>*(see below) is Julian and I live in the city of Rochester, New York to
<nowiki>*</nowiki> escape with my friend Sandy; we write <nowiki>[[books]]</nowiki>.
------------
[subbu@earth lib] echo "[[foo]] [[bar]] [[baz]] x [[foobar]] [[moobar]]" | node parse --html2wt

<nowiki>[[foo]] [[bar]] [[baz]] x [[foobar]] [[moobar]]</nowiki>
------------
[subbu@earth lib] echo "[[foo]] [[bar]] [[baz]] really long string [[foobar]] [[moobar]]" | node parse --html2wt

<nowiki>[[foo]] [[bar]] [[baz]]</nowiki> really long string <nowiki>[[foobar]] [[moobar]]</nowiki>
------------
[subbu@earth lib] echo "[[foo]][[bar]]" | node parse --html2wt

<nowiki>[[foo]][[bar]]</nowiki>
------------
[subbu@earth lib] echo "[[foo]][[bar]]baz" | node parse --html2wt

<nowiki>[[foo]][[bar]]</nowiki>baz

Change-Id: I1048faad788ec89a196660ad7f29756dcdff672d