Implement jar directory snapshot caching.

This improves jar globbing performance by about 4x on a simple benchmark.

For a jar containing 9156 files, 5.times { Dir.glob("file.jar!/**/*") } is:

1.7.10: user    1m24.332s
HEAD:   user    0m19.604s
Made the jar caching respect changing of jars on the filesystem.
Merge pull request #1546 from ratnikov/test-cache-jars

Implement jar directory snapshot caching.