Bug 53359: Fix broken template parameter expansion

Template parameter expansions in a page that contained asynchronous default
values would not properly signal the asynchronous default parameter expansion
to the parent pipeline. They also did not properly strip EOFTk from parameter
expansions.

This resulted in async token buffers being emptied earlier than desired. Async
expansions would fire after the DOM was already fully built and sent to the
client, which in turn caused crashes in production.

Test case:

{{{icon|[[Image:Information.svg|25px|left]] }}} foo {{{{{echo|}}}echo|bar}}

Change-Id: Ib8f3445806864f4f3624fd4d7df24c7400051e1d
Fix bug in foster parented content detection

Introduced in 7bd2df748b013d17971427e953b23a53356a982c.

nextSibling was null for text nodes after wrapping in span, ending the
walk. Adds a test case to ensure subsequent nodes are wrapped.

Change-Id: Ie61ddc5f78e9b62af9441a965e8e66e4b19789d4
Merge "Bug 53359: Fix broken template parameter expansion"
Fix for html2wt crasher: Add TSR info to mw:EmptyLine meta-token

* Template arg escaping relies on tokenizing adding TSR on all
  tokens.  Fixes RT errors on en:Avalon,_Pennsylvania found in
  RT tasting.

* Sample test case extracted from page:

{{Geobox|Settlement
<!-- *** Name section *** -->
| name = Avalon
}}

Change-Id: I6b8acee9af045798a927ebf66ea63209a60393f9
Bug 53407: Don't modify the document after parsing

Our document would be modified right after the callback had fired, which made
further asynchronous processing harder than necessary. This patch delays the
cleanup until the next token is received.

With this in place we can properly sequence gzipping and roundtrip diffing in
tests so that page sizes are always recorded.

Change-Id: I14aa49a86c16219d3340c355aebf9b5b60e37952