Fix equality comparison issues by ensuring DOM only has primitive strings.

The selser code does 'nodeA.nodeValue === nodeB.nodeValue' which was sometimes
returning false for strings with the same contents.  The reason was that
we were allowing non-primitive strings into the DOM (strings created with
'new String', which we did to allow annotating the strings with additional
fields).  Strip the extra fields off and convert to primitive strings before
building the DOM.

Change-Id: Ib27e31fde99b75b3172441b2dfdfdc0ae4164c81
Merge "Fix equality comparison issues by ensuring DOM only has primitive strings."