Fix PEP-8 formatting recommendations in the doc generation code.

This fixes a series of warnings from the pep8 tool in the auto-generating
Sphinx configuration files and our custom Sphinx extensions. These primarily
involve line lengths, missing blank lines, and improper 'not in' conditionals.

Reviewed at https://reviews.reviewboard.org/r/6639/