replace usage of os.popen() with util.popen()
To make this possible, I added a mode parameter to both implementations of
util.popen(), defaulting to 'r' (as it does in the Python stdlib).
created new headdigraph G { -1 -> 0 0 -> 1 0 -> 2 2 -> 3 1 -> 3}