cached-function.hh: fix reset(), improve test.

Now test can be used to test issue #72.
Add a LRU cache and use it for CachedFunction.

This is an early implementation that can still be greatly optimized
(performance, thread safety, etc.). Close #72.
[cmake] Synchronize.