MB-7629: Add support for Javascript view rereduce functions

Besides those built-in _sum, _count, _stats reduce and rereduce
functions for view btree and view id btree, we add support for
Javascript view reduce and rereduce functions. In this txn, we add
support for Javascript view rereduce function and its related unit
tests.

Change-Id: I13e87ec91b63c56ae66316d76bfe543d39968056
Reviewed-on: http://review.couchbase.org/27395
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>