* refactoring: metadata (docinfo) type normalization and add test.