Fix type table lookups of specialized templates.
The typetable can store more than one template parameter lists per
template name. In this case it can happen that a particular template
instantiation matches more than one of the parameter lists because of
wildcards that they contain.
This improves the lookup procedure to look for a "best-matching" template
by ordering the parameter lists according to where they contain
wildcards: Parameter lists that have wildcards in earlier positions
are ranked worse than those that have the wildcards in later positions.
(Note that parameter lists that have the wildcards in the same
positions need not be compared because then they must be different in the
non-wildcard parameters -- although this is not enforced -- and at most
one of them can match.)
Consider the template parameter lists
std::vector<*>
std::vector<bool,*>
Here, the second is a better match than the first.
With this algorithm in place, we can now also define a type display for
std::vector<bool>.