Limit cache size and use LRU policy.

A double linked list holds all cache entries. The most recently accessed
entry is moved to the left of the list. If an insert makes the cache
exceed its limit the rightmost element is deleted.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Remove syntax errors

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>