Fix graphing test

Allow `cylc graph` to print plain graph to standard output if the output
file argument is a `-`.

Use single `perl` command to parse graphing result, instead of 2 `sed`
and a `perl`.
Fix syntax that will break in new versions of bash
Merge pull request #1165 from matthewrmshin/fix-graphing-test

Fix graphing test
Improve names
Merge branch 'master' into improve-job-submit