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.
Merge pull request #75 from bchretien/master

Add a LRU cache and use it for CachedFunction.