Make /submitreview operation more convenient to test

Make some "uninteresting" parameters optional, and support specifying
commits as a list of SHA-1 sums instead of as a list of commit ids.
Adjust behavior of testing framework context manager objects

Specifically the objects returned by the functions frontend.signin() and
repository.workcopy().  Instead of those functions doing the initial work
(signing in / creating the work copy) immediately, delay that to the
returned object's __enter__().  This mostly just Makes Sense<tm>.

(The context manager mechanism is designed to ensure that __exit__() runs
if __enter__() ran, so it makes sense that __exit__() then undoes what
__enter__() did, and thus that __enter__() actually does something.)
Improve rendering of commits and rebases on review front-page

If more than one rebase was listed at the top (not followed in time by
additional commits) then they were listed in reversed order.  This meant
the "[revert rebase]" link didn't work, since it tried to revert a rebase
that wasn't the most recent one.

Also fix the displayed author of the "commit" containing the changes
introduced in a rebase to be the user that performed the rebase.  It used
to display the author of the commit that was at the head of the review
branch after the rebase.

Also fix a rendering glitch when a review branch has had its history
rewritten in a way that simply reset the branch back to an earlier commit.
In that case, that earlier commit could be displayed at the wrong place,
and commits preceding it could be missing entirely form the commit list.
Make handling of fixup!/squash! in branch logs less strict

Always rewrite "fixup! FOO\n\nBAR" into "[fixup] BAR", even if FOO is not
found to reference any commit among the commits being output.  This makes
sense for instance if a review contains only (or starts with) a "fixup!"
commit of an earlier commit not in the review.  And this is just a bit of
UI sugar anyway; there's no particular reason to be strict and not apply
it for commits that are clearly fixups.

The one down-side of this is that commits whose summary is on the form

  fixup! FOO
  BAR

where FOO is not actually a reference to another commit, but rather a
description of this commit (with BAR being a continuation of that
description.)  This is of course an incorrect use of "fixup!", but it's
been known to happen.  Such commits will now be rendered (in a branch
log) as "[fixup] BAR" which will probably not make sense.
Add test for various review rebasing scenarios
Add missing 'tail' column to the reviewmergeconfirmations table

The review merge confirmation mechanism is a sorry user-unfriendly and
untested mess, but it at least doesn't need to crash instantly due to
missing database columns.
Set GIT_{AUTHOR,COMMITTER}_{NAME,EMAIL} variables more consistently

They need to be set when running Git commands that create commits (such
as 'git commit', 'git cherry-pick' and 'git merge') to get the commit
metadata correct.

For this purpose, add a utility function gitutils.getGitEnvironment().

This also fixes a crash when analyzing a non-ff review rebase that had
conflicts.