Introduce Graph::inDegree() and Graph::outDegree() methods.
Clean up the extract() calls in some tests.