Implement key count estimation via AAE trees

This commit adds hashtree:estimate_keys/1 which can be used to estimate
the number of keys in a partition by sampling the segments in the relevant
AAE tree.

The estimation is calculated by computing a keys-per-segment estimate and
then multiplying that estimate by the total number of segments.

The keys-per-segment estimate is determined by traversing over segments
until either 10000 segments have been sampled or 1000 keys have been
seen. With the default AAE settings, 10000 segments correspond to 1% of
the total number of segments.

Authored-by: Mikael Lixenstrand <mikael.lixenstrand@erlang-solutions.com>
Rebased-by:  Joseph Blomstedt <joe@basho.com>
Change AAE key estimation to sample 1% of segments

This commit makes the AAE-based key count estimation sample up to
1% of the number of AAE segments in a tree, rather than the previous
hardcoded limit of 10000 segments.

While 10000 segments does correspond to 1% of the segments using default
AAE settings, the hardcoded limit is incorrect when non-default settings
are used. This commit makes things consistent regardless of the settings.

Authored-by: Kresten Krab Thorup <krab@trifork.com>
Rebased-by:  Joseph Blomstedt <joe@basho.com>
Fix function arity in hashtree:local_compare/2
Simplify hashtree:estimate_keys/3

This commit combines the two terminating conditions for estimate_keys
into a single guard expression, simplifying the code.
Document hashtree:estimate_keys/1
remove unnecessary +1
Merge pull request #633 from basho/feature/aae-estimate-keys

Implement key count estimation via AAE trees

Reviewed-by: engelsanchez