Allow specifying output filename

Probably using a `-o` parameter. Defaulting to stdout would be nice, but networkx wants a string filename -- `"/dev/stdout"` might be the best we can do.