Less feature envy

This adds two feature-envy fixes from eurucamp.

I’m unhappy with the `Attribute#to_mapping` name, so better ideas welcome (as any other comments, obviously). :)