optimized topkeys implementation

Use of binaries speeds it up, but not by much. Slightly less than 10%
in my testing.

Change-Id: Id84b0b89b2f05042004f1d6180d16444b1f8ddce
Reviewed-on: http://review.couchbase.org/38890
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>