Allow subgraphs of series-parallel DAGs

This patch allows the entire series-parallel DAG of a thread to be
constructed or only a subgraph thereof. See also commit 2c18e28fe02460ed5