Output dot file when the suffix of output path is .dot
Fix a bug in older graphviz (requiring escaping for new lines)
A import statement is moved