Move all metadata function into new core/metadata.cpp file. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>