added timed dictionary to expire cache items, added tests, some refactoring