Transparently speed up functions by caching return values
