moved testing helper code to test/lib
seems to mostly work except for multiple edges