Changed LRU algorithm, added tests
Logging and some corrections