added connections from residuals to states in deriv graph
updated depgraph test