Changes to the metadata layer to support plugin metadata implementations

Change already in the 5.0 branch. Adding it to master now.