implement dependency graph

right now list implementation is pretty contrived to work on serial case only.