Improve handling of initial commits when filter changes

Fixes crash when accessing the [pending] filter when the filtered
set of commits includes an initial commit.
Improve support for diffs including the initial commit

It was previously possible to display the initial commit on its own, but
not as part of a "squashed" diff.
Add utility function for filtering elements by class(es)
Add support for testing "non-standard" operations

If frontend.operation() is called with expect=None, the raw content is
returned without any checks (other than checking that the HTTP status was
"200 OK".)

Also, if the 'data' argument is a string, it's used as-is, without JSON
encoding.
Make mailbox.pop()'s filtering somewhat more flexible

Support 'accept' being a sequence of callables.  If all callables return
True the mail is accepted.
Make repository.workcopy() somewhat more flexible

Support creating an empty repository (no content, no remotes.)  Mostly a
useless feature, but convenient if the purpose is to create an "initial"
commit.

Also support running git with custom environment variables; any upper-case
keyword argument to workcopy.run() is set as an environment variable for
the git process instead of being passed to subprocess.Popen().
Add test for diffs including the initial commit

Also creates a review containing initial commit and two followups, and
checks that the various filters ('pending', 'reviewable' and 'relevant')
show the right diff with the right "Squashed History" log.