Better at knowing what get-dependencies calls have been memoized

It turns out that #1162 wasn't that helpful because the project
argument keeps changing. This new version makes the real worker get a
filtered version of project, so that memoization hits are much more
likely.