add Attributes subclass to models

This lets us easily pass around the data without having to deal with database details such as caches and associations.