Added getAttributes() and getAttributesNS() and cleaned up a bit (comments), refs #519