Only expand type/1 macro when requested

Other code may have its own definition of type/1.  For example,
library(type_check) uses the same syntax for type inference.  We only
want library(typedef) to expand type/1 as a macro if the module has
explicitly imported library(typedef).

Once library(type_check) adopts a similar patch, the two modules can
coexist peacefully.
Give each type its own clause in error:has_type/2

For each type declaration or type synonym, create a single clause for
error:has_type/2.  This takes advantage of Prolog indexing to quickly
determine which clause should be used for checking a given type. It
also preserves an existing trick for iterating all known types:

     clause(error:has_type(Type,_), _).