MB-7629: Add structures and operations for view reductions

Change-Id: I75adc5d666b73a115a6154ca8c55084f75493d6f
Reviewed-on: http://review.couchbase.org/25368
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>