Fixed unit tests, added tests for the caching class

Fixed unit tests, added tests for the caching class