reflect/protoregistry: add (*Types).Register{Message,Enum,Extension}

Add type-safe methods to register message, enum, and extension types.
Deprecate the NewTypes function and the (*Types).Register method.

Add (*File).RegisterFile and deprecate the NewFiles function and
the (*File).Register method.

Updates golang/protobuf#963

Change-Id: Ie89e77526e0874539e9bd929ca0ba8d758e65a6e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/199898
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
diff --git a/internal/impl/legacy_test.go b/internal/impl/legacy_test.go
index f55c0d3..8e63ba6 100644
--- a/internal/impl/legacy_test.go
+++ b/internal/impl/legacy_test.go
@@ -52,8 +52,8 @@
 
 func init() {
 	mt := pimpl.Export{}.MessageTypeOf((*LegacyTestMessage)(nil))
-	preg.GlobalFiles.Register(mt.Descriptor().ParentFile())
-	preg.GlobalTypes.Register(mt)
+	preg.GlobalFiles.RegisterFile(mt.Descriptor().ParentFile())
+	preg.GlobalTypes.RegisterMessage(mt)
 }
 
 func mustMakeExtensionType(fileDesc, extDesc string, t reflect.Type, r pdesc.Resolver) pref.ExtensionType {
@@ -82,7 +82,7 @@
 	testMessageV1Desc = pimpl.Export{}.MessageDescriptorOf((*proto2_20180125.Message_ChildMessage)(nil))
 	testMessageV2Desc = enumMessagesType.Desc
 
-	depReg = preg.NewFiles(
+	depReg = newFileRegistry(
 		testParentDesc.ParentFile(),
 		testEnumV1Desc.ParentFile(),
 		testMessageV1Desc.ParentFile(),