Simple memoization of function executions.