Add an is_enabled_for mechanism for NavigationBarHook.

This adds a way for NavigationBarHooks to be enabled/disabled per-user. This is
done by adding a new, optional is_enabled_for flag to the constructor, which is
a callable that returns either True or False.

Testing done:
- Ran unit tests.
- Used this in an extension.

Reviewed at https://reviews.reviewboard.org/r/6390/
Fix up password reset template to use modern CSRF protection.

Once upon a time, we rolled our own CSRF protection. This file was somehow
never updated for it, and still had a comment about what we should do when
moving to Django 1.2(!).

Testing done:
Went through complete password reset flow.

Reviewed at https://reviews.reviewboard.org/r/6405/
Switch to a different version of marked.js that fixes in-word underscores.

marked.js has an infuriating bug that even when "github flavored markdown" is
turned on, it has problems with underscores in the middle of words. Worse, it
didn't handle escaped underscores in the middle of hyperlinks, so even when
they were escaped, it was broken in some cases.

This change pulls in a version of marked.js from an open pull request that
fixes these bugs, which means that we no longer have to escape them.

Testing done:
- Ran unit tests
- Posted some changes with underscores mid-word, saw that the escaping was gone
  and that all text looked correct (with no unexpected em or strong).

Reviewed at https://reviews.reviewboard.org/r/6415/
Stop creating an unwanted history entry on view diff.

In Firefox changing the url hash by setting window.location.hash creates
a history entry. This behaviour is different from chrome et al so
instead we now use window.location.replace to avoid the extra entry.

Firefox will no longer return to #index_header when hitting the back
button after having clicked view diff.

Testing Done:
Visited the diff viewer using View Diff in both Firefox and Chrome
before and after the fix. Chrome's behaviour is unchanged and Firefox
no longer has the additional unwanted history entry.

Reviewed at https://reviews.reviewboard.org/r/6414/
Fix parsing of perforce CLNs with multiple sections.

As part of the updates to make code compatible with Python 3, I removed the map
call that was used to do pairwise iteration of the sections in VMware-formatted
changelists, and replaced it with a zip. Unfortunately, map and zip have
different behavior, and this would end up chopping off the last section.

This change replaces it with a much more basic index iteration.

Testing done:
Verified that the iteration method cycled over pairs in the expected fasion.
Sent a patch to VMware for them to verify in production.
Allow specifying ?force-text-type=html to Markdown-capable API resources.

Many of our resources support passing ?force-text-type=plain|markdown to
convert to either plain text or Markdown format. Now, these also support
"html" to render to HTML.

This is the first step to moving entirely to server-side rendering of
Markdown content.

Reviewed at https://reviews.reviewboard.org/r/6406/
Support Markdown in the Submitted/Discarded text fields.

We didn't have any proper support for Markdown text in the
Submitted/Discarded text fields before, due to lack of proper plumbing
in the API and in ReviewRequest.close().

Now it's possible to write Markdown and save it. It will render both in
the banner and in the change description box.

Reviewed at https://reviews.reviewboard.org/r/6409/
Improve close description support in the API.

The review request resource now has a 'close_description' field that
will be set to the close description text, if provided and if closed.
This makes it easier to see the status of a review request without
digging into other resources.

This also deprecates the 'description' field when closing a review
request through the API. The new argument is 'close_description', which
matches the returned value and doesn't conflict with the field.

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