Allow persistence of hash attributes

This is not perfect. It needs to be improved, as mentioned in issue #23.