relocates the static functions from metadata.h and adds MetadataCopy() to the interface Change-Id: I28bfa9233d3dd70dddf6b561fe0bf4be378db1ec