Support a cache parameter to for cross-process memoization. Fixes #2