new Type module, to deal cleanly with types. Updated Term to use those.