Formalize metadata management into a Manager class

This allows the manager to be accessed and better data clearing when
plugins unload.