Added DAG base class, test function, updated other classes to use graph methods