Fix formula related bugs from model reform.

[Fixes #83347984] Using an attribute in a formula showed type error in the table.
This was due to a confusion over which collection object was referenced by an Attribute.

[Fixes #83349312] Created attribute values did not restore in imported document.
This was due to defects in the toArchive method of Attribute.