Encapsulate the creation of `Attribute` objects

Depends on #15868

This will make it less painful to add additional properties, which should persist across writes, such as `name`.