Move Dependants common code to graph

I want to be able to use this code on something other than producers and almost none of it was specific.