Attribute namespaces

Completes #339 #340 #341