Automagically memoize any function, and save results on disk (for Java).