Add an AttributeContainer class.

This eliminates duplicate handling of attributes.
Unpack variable data from header.