Remove redundant function

The class review.filters.Filters has two isReviewer() functions, one
that uses __getUserFileAssociation() (the correct one) and one that
essentially inlines __getUserFileAssociation() (the now removed one.)

Don't know how that happened.
Move review.utils.countDraftItems() into dbutils

That way it's closer to its only user, dbutils.Review.getDraftItems().
Use new-style classes
Import fewer things globally in the 'dbutils' module
Add debugging code for incorrectly re-used cursor objects

If a cursor object is currently being iterated over, it's a bad idea
to execute a new statement using it.  What's worse, the database query
profiling preference hid the problems caused by doing so.

With this code (which is only used when query profiling is enabled)
incorrectly re-using a cursor object while iterating over it triggers
an exception the next time next() is called on the iterator.
Tweak dbutils.User class a little

Move static makeAnonymous() function down to the other static functions.

Don't load all preferences when setting one, and update the cached or
loaded preference value when setting the preference.

Raise base.ImplementationError exception instead of Exception when
attempting to read a preference that doesn't exist in the database.

Assert against using str() or int() on anonymous user.  They normally
return the user name or id, and anonymous users have neither.  (And
Python doesn't allow returning None from __str__() or __int__().)

Use isinstance(X, basestring) instead of isinstance(X, str).
Remove dbutils.User.retire()

Call review.utils.retireUser() directly instead in the one place where
it was used.
Clean up path functions a little

Primarily avoid doing

  try:
    # code that is expected to fail in certain conditions
  except: pass

and instead do things that are not expected to fail and specifically
detect the expected "failures" and handle them, thus avoiding masking
unexpected errors.
Disable branch tracking when review is closed or dropped

Makes little sense to continue, since pushes to the review branch will
be rejected either way.
Remove dbutils.Review.getCommentChains()

The function was called from a single location, and had two modes, one
in which it simply called CommentChain.fromReview() and one in which it
ran a database query and created CommentChain objects itself.

Only the former mode was ever used so the single location in which this
function was used now calls CommentChain.fromReview() directly instead.
Rename "review" package to "reviewing"

The name "review" is unfortunate since that's a very natural name for
a local variable referencing "the review," which means the package in
the global scope is shadowed locally.  This has lead to the package's
modules almost always being imported as

  import review.FOO as review_FOO

as a work-around.  This workaround is kept in this commit, thus
reducing its immediate impact to just modifying import statements.
Split 'dbutils' module into one file per class

There's now a package named 'dbutils' instead, but its __init__.py
imports everything from the sub-modules that was previously available
in the 'dbutils' module, so to the rest of the code, nothing changes.