Make FormatCommon do not create an empty 'bucket tree' when deserializing
Fix RevTree.EMPTY to have a proper SHA id.

The RevTree.EMPTY "null object" had ObjectId.NULL as its identifier
instead of the proper SHA id that would result of hashing an empty tree.
This lead to a bunch of "special cases" instead of helping out.

This patch makes it so that RevTree.EMPTY has a proper hashed identifier,
updates InitOp to initialize the WORK_TREE and STAGE_TREE refs accordingly,
reduces the number of special checks.

Note for the sake of safety, InitOp also makes sure that the real
empty tree exists in the ObjectDatabase.
Merge pull request #746 from groldan/rev_tree_empty_fix

Fix RevTree.EMTPY to have a proper SHA
Add --count option to cli's diff command
Huge performance improvement to compute the number of changes with path filtering.

This patch introduces two new methods to the DiffTreeVisitor.Consumer interface:
endTree(Node left, Node right):void and
endBucket(int bucketIndex, int bucketDepth, Bucket left, Bucket right)
that are called after the tree(...):boolean and bucket(...):bookean respectively,
regardless of their return value.

This allows consumers to keep track of more info like what the current tree
path is at any given event.

With that in mind, DiffCountConsumer is updated to use a filtering decorator
when path filters are given, and hence get rid of the separate code path it
was using for that case, that forced a full traversal of a DiffTreeIterator.

This results in an impressive performance improvement as now DiffCountConsumer
can skip whole trees and buckets and address only the ones that can possibly
match one of the path filters.

In a repo of ~2M osm features with ~1M changes between the diff'ed commits,
and filtering with 10 path filters, we're talking of an avg execution time
of ~5 milliseconds as opposed to ~3000 milliseconds.
Update diff man page with the new --count option