Ran flake8 over directives.py

And fix all the issues or ignore them in the config. I'm not up for 80
character line limits and I'll put blank lines at the end of files if I
want to.

Contains very few changes other than whitespace. Mostly the switch from:

    self.options.has_key('content-only')

To:

    'content-only' in self.options

As recommended. Plus removing a few unused imports and unused variables.
Ran flake8 over more files

And fixed various issues where possible.
Ran flake8 over finder subdirectory
Ran flake8 over compound parser file
Merge branch 'flake8'
Fix ref_matcher mistake

Having tested it a little with using the ref_matcher_stack instead of
the matcher_stack, it seems that using the matcher_stack is correct
despite the comment. So we remove the comment.

Everything fails if we switch it and the original commit message isn't
helpful enough to understand what is going on.
Run spellcheck on the documentation

Using Doug Hellmann's sphinxcontrib-spelling extension.

Catches a lot in the actual docs but then some in our third party
example files as well which we care less about but fix for the sake of
clarity.

There is a bit of a mix between putting words in the general exlusion
list and putting words into individual files but we get there. Could
be more consistent.
Make spelling extension optional

Probably a better way to handle this but for the moment we remove
anything that depends on the spelling extension so that we can run the
build without it installed.
Merge branch 'spelling'
Migrating from print statement to function
Migrating to the new exception python syntax
Merge branch 'contrib'