Remove NAMES global type namespace

We now pass around an instance of JavaTypeNamespace to
resolve types.

Add a const pointer to this namespace to java Type objects.
This enables a lot of cases where we need to refer to the
type namespace as we dynamically resolve types.

Prototype a method to remove INT_TYPE global constant by looking
up the appropriate type in an instance of JavaTypeNamespace.

Bug: 24303749
Test: Compiles, unittests pass

Change-Id: I3bb25ffb875e1e55f0548b6cd0e84e3e8bbf817e
diff --git a/ast_java_unittest.cpp b/ast_java_unittest.cpp
index ecf80c0..b7bbb5a 100644
--- a/ast_java_unittest.cpp
+++ b/ast_java_unittest.cpp
@@ -36,8 +36,9 @@
 }  // namespace
 
 TEST(AstJavaTests, GeneratesClass) {
-  Type class_type("TestClass", Type::GENERATED, false, false);
-  Type extend_type("SuperClass", Type::BUILT_IN, false, false);
+  JavaTypeNamespace types;
+  Type class_type(&types, "TestClass", Type::GENERATED, false, false);
+  Type extend_type(&types, "SuperClass", Type::BUILT_IN, false, false);
   Class a_class;
   a_class.comment = "// class comment";
   a_class.modifiers = FINAL;