Fix for cache locking. Release loop prevention and some refactor.
Merge branch 'cache_lock' into devel
Fix delete method on Cache/Base class (not applying sha1 to key)
Merge branch 'cache_delete_fix' into devel