Change the LRU cache to a simple in-memory model

Slight memory increase when there are lots of additions for much better performance
in every case.