MRG: refactor and bugfixes for plot_directive

Fix ugly output when not linking to source
Remove copy of relpath as no-longer needed
Fix some typos
Remove unused imports
Some PEP8 whitespace
@mdboom `git blame` informs me that you wrote this line, but it's too early for me to think of anything facetious to say regarding the use of superfluous 'u's.