Make less file system access to the cache.

This speed up the loading and the refresh.
The refresh with a local cache with ~650 element went from 0.01s to 0.001s.
make less useless file system access
Refresh the theano cache when starting a new function compilation.

This fix problem of some module in the cache being skipped.
Merge pull request #1741 from nouiz/cache

Fix recompilation of Ops in other repo then Theano