Improve formatting for Markdown.

We try to keep our Markdown rendered output as close as possible to the
source text formatting, but there's only so much that can be done by
CSS. This change massively improves the rendering by introducing a set
of new Markdown processors that clean up newlines and attributes, giving
us the output our users would expect.

This primarily does the following:

* Keeps the correct number of blank lines between blocks (by default,
  Python Markdown will just trim them away).

* Keeps code blocks (and certain other extension-provided blocks) from
  having an unnecessary extra blank line after the HTML (interfering
  with our <pre> formatting).

* Allows line breaks in lists.

* Wrapped lines of text inside an ordered list item no longer shows the
  wrapped text at the same indentation level as the item's counter
  value. It now properly stays within the confines of the list item.

  To make this happen, we had to use CSS counters and some custom
  styles (using `display: table` and friends).

* Allows ordered lists to start at a particular value. We do this by
  turning off lazy_ol, which gives us a start= attribute on the list.
  Then, to get it to play nice with the custom counters mentioned above,
  we have a Markdown block processor that adds CSS to the <ol> that
  initializes the counter to the right value.

* Adds unit tests to ensure these formatting rules do not break in
  the future.

The result is much nicer formatting for most cases (all cases I've
tested).

Reviewed at https://reviews.reviewboard.org/r/6643/
Fix PEP-8 formatting recommendations in the diffviewer module.

This fixes a series of warnings from the pep8 tool involving missing
whitespace, excess spaces, line length issues, and visual indent
errors in the diffviewer module.

Reviewed at https://reviews.reviewboard.org/r/6630/
Fix PEP-8 formatting recommendations in the attachments module.

This fixes a line length issue in the attachments module, reported
by the pep8 tool.

Reviewed at https://reviews.reviewboard.org/r/6627/
Fix PEP-8 formatting recommendations in the extensions module.

This fixes line length and visual indent warnings from the pep8 tool
in the extensions module.

Testing Done:
Ran unit tests for diffviewer module, and ran pep8 again.

Reviewed at https://reviews.reviewboard.org/r/6631/
Fix PEP-8 formatting recommendations in the hostingsvcs module.

This fixes a series of warnings from the pep8 tool involving too many
blank lines, missing whitespace, and line length issues in the hostingsvcs
module.

Reviewed at https://reviews.reviewboard.org/r/6634/
Fix PEP-8 formatting recommendations in the reviews module.

This fixes a series of warnings from the pep8 tool involving indentation,
missing blank lines between classes, line lengths, excess spaces around
operators, and excess '#' symbols on comments.

Reviewed at https://reviews.reviewboard.org/r/6635/
Fixed PEP-8 formatting recommendations in setup.py and settings.py.

This fixes a series of warnings from the pep8 tool involving line lengths,
excess spaces around operators, and inconsistencies around a regex line
wrapping in setup.py and settings.py.

Reviewed at https://reviews.reviewboard.org/r/6638/
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/
Fix PEP-8 formatting recommendations in the webapi module.

This fixes a series of warnings from the pep8 tool involving extra
blank lines and the formatting around a query calculation for diffs.

Reviewed at https://reviews.reviewboard.org/r/6640/
Improve escaping text for display in Markdown.

Our former approach of escaping text for use in Markdown was to define a
large regex containing patterns, and any pattern that matches was
fully escaped. This was fine for simple patterns, but it wasn't possible
to escape only a single character or set of characters in more complex
patterns.

Each pattern in the regex can now capture zero or more groups, each of
which will be individually escaped. To do this, we loop through the
groups, escaping each match and inserting that into the resulting
string. It means we do loop on each match through each possible capture
group (including those from other patterns), but it also means we no
longer have to go back through the whole string looking for and escaping
characters, just subsets. (We're really talking a ~50 microsecond
difference for a commit message with a handful of Markdown-unsafe
content anyway).

With this change, we were able to make two escaping fixes:

1. Lines starting with things like "1.2.", which are not list items,
   are no longer escaped.

2. '>' characters are no longer escaped unless they're an autolink
   (like <foo@example.com> or <http://example.com>) or a blockquote
   (single level or nested).

Reviewed at https://reviews.reviewboard.org/r/6653/
Fixes tabs appearing in the subject line of emails.

Python 2.7 has a problem that causes tabs to be used to break up long headers
instead of spaces. When Review Board sends an email with a Subject longer than
62 characters, it inserts a tab to seperate the text into mutiple lines.

Now instead of the Subject header being seperatated by tabs it is seperated by
spaces.

Testing Done:
Ran unit tests.

Bugs closed: 3613

Reviewed at https://reviews.reviewboard.org/r/6647/
Merge branch 'release-2.0.x'