Extmetadata

-externalize metadata as file
-enable writing metadata inline in entity as json
-add tests
-archive metadata-files