Refactored attribute expansion to DOM into a Util method

This could potentially be useful in the image handling code
to deal with templated attributes that are currently getting
past the AttributeExpander. Alternatively, we may redo how
attributes are handled a bit to trap all templated attributes
independent of whether they are real attributes or not.

But, in either case, this refactoring should not affect
functionality.

Also documented couple methods in Util.

Change-Id: Ided7ca3da9686b614bda439f3b8d752d0afde024
Merge "Refactored attribute expansion to DOM into a Util method"