Restructure PersistentMetadataValue

Restore type-specific constructors, and add asList and asMap accessors.
I did not add array accessors.