Be a little smarter about dealing with TypeDefs, resolve to the typedef'd

target at lookup time, so all code ever sees is anything _but_ TypeDefs.
Also verify that the optional Enum storage type is valid (i.e. an enum
or an integer type) and re-emit enum values for derived enum types.
diff --git a/EnumType.h b/EnumType.h
index 2bb258c..939cd3b 100644
--- a/EnumType.h
+++ b/EnumType.h
@@ -14,8 +14,13 @@
     EnumType(std::vector<EnumValue *> *values,
              Type *storageType = NULL);
 
+    const Type *storageType() const;
+    const std::vector<EnumValue *> &values() const;
+
     const ScalarType *resolveToScalarType() const override;
 
+    bool isEnum() const override;
+
     std::string getCppType(StorageMode mode, std::string *extra) const override;
 
     void emitReaderWriter(