Move out directed graph from mutex.c to dag.c.

Gives a clearer separation between graph functionality and mutex overrides.