Add a cache to getPublicQualifiedName().

After running the racing demo for one lap, this cache has 252 entries
and a 99.87% hit rate, and has reduced the cumulative JS allocations by
about 15%.