Add TypeBasic and toBaseType, isBasicType. Remove unused code. Clean up. Optimize enums.