Initial Attr support and namespaces for attributes.

Needs some cleanup from bad merges, but making a PR now to get high-level feedback about the approach used.