added misc:sort_and_keygroup

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