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