Fix selecting text within a single line in the diff viewer.

The new text selection code only worked if the selected text had a <tr>
in it. If it didn't, we'd end up with an empty clipboard.

We now check for this condition, and just grab the text contents of the
selection.

Fixes bug #3631
Reviewed at https://reviews.reviewboard.org/r/6492/
Fix navigating to comment flags through key bindings in the diff viewer.

The support for navigating to comment flags using key bindings was
broken, due to looking up the wrong class. The class name has been
corrected, allowing navigation to work as expected.

Fixes bug #3626
Reviewed at https://reviews.reviewboard.org/r/6493/
Improve summary search speed on large installs.

Search for summaries in the quick search is very slow, for a couple of
reasons. We didn't have an index on the summary, but even if we did,
we were looking for text in the middle of the summary field, which
indexes can't help with.

This could cause real problems on large installs, slowing down the
database making it nearly impossible to find what you're looking for.
Continuing to type would trigger further expensive queries, eventually
resulting in other queries stalling on the server.

To fix this, we now have an index, and we now search only the beginnings
of summaries. We also only start searching if we have 4 or more
characters. It limitation on where we search sucks, but it's better than
nothing.

Theoretically, we could use the search index, but more work must be done
to make that happen.

We could also, theoretically, use the full-text search feature for
MySQL, but not all versions support that for InnoDB. Work would need to
be done to introspect whether we can use full-text search, and it would
require hand-applying some SQL to the database. It also wouldn't buy us
anything for other types of databases.

This may limit the usefulness of quick search for summaries until we
come up with something clever, but at least it won't break servers.

Fixes bug #3619
Reviewed at https://reviews.reviewboard.org/r/6494/
Fix problems in hardened password storage.

The password storage had a couple of bugs when saving empty passwords.

If a password was not set, but we tried to store it, we'd get '\tNone'.
This was due to always prefixing with the encrypted password marker, but
not actually encrypting the string. This would then break when we went
to load it, since 'None' wasn't an encrypted password.

We have to work around the loading, so we now check for '\tNone'. Sucks,
but now necessary. Down the road, perhaps we can convert any that are
busted during upgrade.

Storage has been fixed to serialize None values correctly.

Reviewed at https://reviews.reviewboard.org/r/6495/
Fix warnings about naive datetimes.

When we added timezone support, we updated almost everything to use it. The one
thing that was missed was the widgets in the admin dashboard, since we didn't
look at them too much. This meant that the log files were getting spewed with
warnings any time a user viewed the dashboard.

Testing done:
Viewed the dashboard and saw that there were no more naive datetime warnings.

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