Clarify documentation and logic for Attribute.modifyAttr

Whilst explaining to a colleague why we were using modifyAttr for something, I discovered that the documentation is unclear about using it to add new attributes.

I also took the opportunity to simplify the codebase slightly.