Re-apply "Make the DOM hash ignore text node splitting"

This reverts commit 52437882d7a96e85942359c01fff92042f0cb469 and reinstates commit Ia04f7195ef6.

Change-Id: I42ff221d5a8f87f888a722f6e0bec48592286b20