added #type_namespaces and #type_definitions
implemented extensions and deferred types