WIP: Features/fine grain invalidation

Here it is an attempt to make this more usable by invalidating the cache with a bit more care.

The changes below reduce the time required to upload an image to the clipboard significantly. We are going from almost 12 min to a bit more than 1 min on my laptop and 19s on a rackspace cloud server.

@bkonkle does it seems reasonable ?