Fix unit tests.
Add per-process result caches.