Keep defined order of HTML attributes

This change will keep the order of html attributes of the expanded text
the same as it is defined in the the abbreviation.  It also makes sure
that if an id and or class attributes are set then they will always be
first.