Added fault tolerant caching and fixed a couple bugs.

@mszenher , @fosdev , @pmavinkurve-mdsol 

Added fault tolerance and a spec to test it.

...................................................................................................................................................................................................................................................................
Finished in 0.456608 seconds.

259 tests, 917 assertions, 0 failures, 0 errors