Fix derpy metadata handling in ID lists, sillyness in ConfigManagerCore ...

...and a potential memory leak

Rebased version of #879