Restructure the 'index' module

This is very old code (relatively speaking) and it was rather extra poorly
designed.  It had module global state (a |db| variable) and passed around
repository and user names instead of repository and user objects.

It also needed to represent that the acting user was "the system" and did
so by letting the |user| variable that normally referenced a dbutils.User
object reference a plain string instead (whose value was the name of the
system user.)  To improve the situation, add support for representing the
system user as a proper dbutils.User object similar to how we represent
an anonymous user already.

This is meaningful clean-up in itself, but the immediate motivation for
these changes is to make the 'index' module directly usable from other
code, thus avoiding the need to use 'git push' to make changes to the
repository.  Avoiding that can make code elsewhere more straight-forward,
and also faster.
Fetch remote branches without a relay repository

Modify gitutils.Repository.fetchTemporaryFromRemote() to run directly in
the target repository, by fetching to a temporary ref (whose name includes
a timestamp and a some randomness) and processing the fetched commit by
calling index.processCommits().

Creating a relay copy is usually very cheap, but does become expensive if
the main repository has very many loose objects.  A single fetch directly
in the target repository should also be quite a bit faster than a clone,
a fetch in the clone, and then a push back to the target repository, even
in the best of cases.