Selective serializer and DOMDiff fixes

Fixing the async code paths not tested in parserTests. Also a mix of code
fixes in DOMDiff, new methods in DOMUtils and minor tweaks in
WikitextSerializer.

312 additional (vs. master) selser tests are green with this patch.

Change-Id: If95092f86ad82329139582a6a5cb2d6d337cbaf0
Merge "Selective serializer and DOMDiff fixes"