add test cases for digraph-io, and some minor rearrangement of files and
functions.