refactored Resource.Metadata to ResourceMetadata (ref #176)