Encapsulate the creation of `Attribute` objects

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