Fixed getAttributes() and added getAttributesNS()
Fixed attribute lookup ordering to better support global attributes