clean up static imports
remove obsolete code
#537 correctly detect circular type alias definitions (and relax
restriction that aliases can not be defined in terms of other aliases)