Escape text for markdown when updating from pending or committed changes.

When updating from a pending changelist (perforce) or a committed change
description (svn or git), we may need to escape the description and/or testing
done fields. This adds the relevant calls to do so.

Testing done: Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/5006/
Fix typo in Search view

kwargs was being passed without expansion, causing a type error.
HTTP Basic authentication does not work with fastcgi

HTTP basic authentication fails to work when using the fastcgi configuration,
thus the API does not work. Solution suggested from
https://bugs.php.net/bug.php?id=35752

Testing Done:
Without the patch API calls fail. With the patch API calls succeed.

Reviewed at https://reviews.reviewboard.org/r/4934/
Merge branch 'release-1.7.x'
Kill ancient post-review documentation and link people to rbt post.

The Review Board user manual still had a page on post-review, which was mostly
correct but didn't have any information on rbt at all. We also only linked
people to this from the user manual, instead of to our newer rbtools
documentation.

I've removed all content from the old tools/ directory and added links to the
RBTools manual, and cross-linked anywhere that used to link to "post-review" to
"rbt post" in the rbtools documentation.

Testing done:
Built html docs and checked that links were all correct and that the old
post-review doc was dead.

Reviewed at https://reviews.reviewboard.org/r/4998/
Un-escape markdown in text emails.

There's not a lot of processing we care to do for markdown in text emails, but
the escape characters for auto-escaped descriptions and comments is annoying.
This adds some processing that de-escapes markdown text for the text email
templates.

Testing Done:
Looked at the review request, review, and reply preview-email pages.

Reviewed at https://reviews.reviewboard.org/r/5011/
Fix regression in comment dialog dragging.

The way that the comment dialog was made draggable regressed, possibly due to
upgrading jQuery UI. The result was that the entire dialog except for the
resize grips was treated as draggable, making it impossible to use the mouse to
select text in the editor. Switching it to pass in a selector instead of a
jQuery makes it work properly again.

Testing done:
Opened a comment dialog on a diff and checked that I got the correct cursor on
the title of the dialog, and that I could only drag that dialog around by
clicking on the title. Checked that I could now select text in the editor.

Reviewed at https://reviews.reviewboard.org/r/5016/
Improve the look and feel and extensibility of the login/register pages.

The login and register pages have looked pretty terrible for a while,
and weren't at all extensible. This change cleans them up quite a bit
(both the visual style and the underlying code) and adds reusable CSS
classes and support for template hooks.

It also no longer hard-codes the description telling you to use your
standard username/password if registration is disabled. Instead, any
auth backend can provide login instructions, regardless of whether
registration is allowed. The instructions will appear immediately below
the header for the page.
Properly handle incorrect revisions in the github get_change() implementation.

The get_change() implementation in the GitHub hosting service was letting a
bare Exception through in its failure case, which I think only really happens
when GitHub's API is having problems. This meant that the API would return a
500 and we'd get a traceback in our email. I've changed it to catch Exception
and re-raise as SCMError, which is caught by ReviewRequestResource.create()

Testing done:
Ran unit tests

Reviewed at https://reviews.reviewboard.org/r/5015/
Support two-factor authentication for GitHub.

This adds support for two-factor authentication when linking an account
for a GitHub repository. Two-factor auth is much safer, and is something
to be encouraged, but was not previously usable with Review Board.

We only ever authenticate when linking an account for the first time, in
order to get an OAuth token. The repository form now has support for
HostingServices to raise a TwoFactorAuthCodeRequiredError, which
indicates the service needs an authorization code to continue.

The repository form responds to that by displaying a field where the
user can enter their auth code. The HostingService will be passed this
code and can include it in the authorization request.

There are no other points where a two-factor auth token is needed for
GitHub, since requests using OAuth tokens do not need two-factor auth
tokens.
Merge branch 'release-1.7.x'