Added ClassDiscoveryCache, which manages writing out the cache files to disk.

It doesn't appear to work, but the bulk of the code is there, and should be down to
just a bug fix or two.
Tied the caching into cmdline mode, and fixed a bug with the ClassDiscoveryCache.

Barring final testing, this *should* be fully working now, and nearly ready to be
merged into master.