Add MetadataLoader changes from Google r656

Note: This does not add the newInstance/setInstance changes from upstream.