Reorganized imports, made run_dot in charge of file operations since it already takes a file_name argument and the others seem to take run_dot's output and write it to file_name anyway.