First step to support join against an internal store in scalding

The meat is not here, but probably half the work (and none of the tests).

@ianoc and @egonina Can you take a look and give feedback?
no, because the gate function takes a function1, but gate is function2, but this gives me some ideas to use more case matching and clean it up.