Add useful HTML in toDomElements for refs and templates.

For the benefit of pasting out of VE.
Use data-ve-ignore where necessary to avoid the HTML being
used on the way back in to VE.

Change-Id: Iabe678c4246c1d1f51abb058b6e750811fdf9bea
Merge "Add useful HTML in toDomElements for refs and templates."