More encapsulation work.

Use the AttributeSet when we're talking about more than one attribute. Add a
function that adds a single attribute. No functionality change intended.