Add a hierarchy of identities for tools

For instance, you might have ["clang++-3.4", "clang++", "c++"]. Currently,
the hierarchies are hardcoded, but that'll be fixed eventually. The hierarchy
will be useful for being able to do things in tests for only a certain subset
of compilers, e.g. to skip a test if MSVC is the compiler used, or to pass raw
arguments to compilers (since they may have different options).