Restore perf improvement from #1554

Lower-case attribute names when parsing selectors rather than when matching. This avoid one allocation in matching code.

Also do not lowercase names for *AttributeNS APIs. (Move lower-casing to callers.)