Yet another memoizer for synchronous functions and methods