cleanup
register metadata before actual initalization

fixes #329
Merge pull request #361 from copierrj/3.4-bug-329

Fix for bug #329: Resource configuration file disappears after edit and save/save+apply