Properly implement dependency directory selection

So this PR changes the problems told in #10 . We are almost to the point where we can make groups of dependencies, but this will land in another PR when this one is merged.

@Stapelzeiger can you test this on your use case and report please ?