Fix trimming trailing paragraphs in Markdown that contain elements.

The code for trimming empty paragraphs didn't consider that a paragraph
may have children but not text. It now checks for any child nodes before
determining whether to trim.

Reviewed at https://reviews.reviewboard.org/r/6671/
Remove illegal characters from XML strings before parsing.

It's easy for people to unintentionally inject XML-unsafe characters
into a string from a copy/paste when filling out the Description or
Testing Done fields of a review request.

We now sanitize the XML before attempting to parse it, removing any
illegal characters. The result is a string that can be safely parsed
with no noticeably defects.

Reviewed at https://reviews.reviewboard.org/r/6670/
Merge branch 'release-2.0.x'
Fix style inconsistencies in review request change descriptions.

There were major two inconsistencies between the Markdown-capable review
request fields and the change description rendering.

Visited links in the fields would appear with the standard purple color
(or whatever is used by the browser). Non-visited links would appear in
the standard blue (or, again, whatever is used by the browser). However,
change description text would force blue. Now we use the default color
for the browser, including the default visited link color.

Code blocks also appeared too big in the change description text. We now
set it to use the same font size as the parent rich-text div.

Reviewed at https://reviews.reviewboard.org/r/6654/
Allow links to work in custom review request action drop-downs.

Custom review request actions in drop-downs weren't able to link to other
pages, due to the drop-down menu's action handler preventing events from
propagating.

We now only prevent propagation for the menu label itself.

Testing Done:
Testing was only done on the review_export extension and all core menu functionality.

1. Checked other dropdown menus to see if their actions worked (Close -> Submitted, Close -> Discarded)
2. Tried the primary menu actions (actions with no dropdowns)
    a) View Diff
    b) Download Diff
    c) Review
    d) Ship It!
3. Tested the functionality on File Attachment actions:
    a) Update
    b) Delete
All Worked successfully.

Reviewed at https://reviews.reviewboard.org/r/6669/
Add Mark Loyzer to the AUTHORS file.
Merge branch 'release-2.0.x'
Fix missing variable declarations in auth backends.

The auth backends were attempting to decode UTF-8 username strings into
byte strings before operating on them, in order to convert them to a
format expected by the libraries providing authentication. If a byte
string is passed in, though, the variables are never declared, causing
errors.

This fixes this case, adding the missing variable declarations.

Reviewed at https://reviews.reviewboard.org/r/6672/
Add WebAPICapabilitiesHook, for adding capability listings to the API.

This introduces a new WebAPICapabilitiesHook that extensions can use to
register a set of custom web API capabilites, displaying in /api/ or
/api/info/.

This hook handles registering and unregistering the sets of web API
capabilities. Documentation and sample code was added, detailing the use
of the hook.

Reviewed at https://reviews.reviewboard.org/r/6613/
Fixed a very small typo in the Web API documentation.

In the documentation for Review Request Resource, the description of `approved`
should be "a review request is approved if it has at least one Ship It! and
*no* open issues."

Reviewed at https://reviews.reviewboard.org/r/6673/
Merge branch 'release-2.0.x'
Make convert_to_unicode handle bytearray.

Some SCM backends (notably Perforce), when dealing with files which are marked
as binary but aren't actually binary, will return a bytearray instead of bytes.
This wasn't properly handled in our unicode conversion step. I've fixed it to
check if the input is a bytearray, and convert it to bytes if needed.

Testing done:
Manually called convert_to_unicode with a bytearray and saw that it no longer
raised an error.

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