Support widgets in templates.

Part of this change is to make templated set the DOMNode property or the DOMNode
attribute, depending on which field you are trying to set.
Often setting either one is OK, but you need to set properties to
affect input.value and widgets, and you need to set attributes for
things like role, that have no associated property.