Metadata editing

(close to be refactored, but not tested yet)