Temp dir now properly cleaned up

Uses a test rule to ensure the temp directory is cleaned up as soon as
the test is completed. This prevents potential problems with re-running
the test and having an old directory present.
Removed errant spaces
Replaced synchronized with ReentrantReadWriteLock

This removes all synchronized statements in favor of a
```ReentrantReadWriteLock```. This allows read operations to not block
each other, but write operations to block everything (*the way
synchronized was working previously*).

With the addition of a simple ```contains()``` method, it is now super
cheap to check if an image exists in the cache.