Fix domIndex problems in updateDomFromState.

Can't assume template's first element is the first element in the parent
element.
Remove unnecessary text nodes.

Remove console statements.