Rework metadata format. Add metadata loader and parser.