Add dynamic attributes to the Metadata entity

Dynamic attributes are needed so that old versions can maintain
new unrecognized attributes that are added in newer versions. Unless
the Metadata entity stores such attributes they might be lost since
that entity is sometimes serialized and deserialized.

This commit ensures that attributes that are not recognized during
deserialization are stored in an internal 'dynamicAttributes' map.
The entries of this map will then participate in subsequent
serializations of the Metadata instance, hence leaving the actual
JSON structure intact with all attributes.