Extend _sum to operate on JSON Objects
Extend _sum to operate on JSON Objects

A map function that emits JSON objects as values can now be used with
the builtin _sum function.  In contrast to our support for JSON arrays
(which can be freely mixed with numbers), this extension requires an
all-or-nothing approach - either emit only objects or do not emit any at
all.  Moreover, all the fields inside the object must have values that
are numbers or arrays of numbers.

TODO use proper instead of writing explicit unit test cases

BugzID: 14798

cloudant/couchdb-couch,alanning/couchdb-couch,ngpestelos/couchdb-couch,ngpestelos/couchdb-couch,smithsz/couchdb-couch,KlausTrainer/couchdb-couch,fkaempfer/couchdb,smithsz/couchdb-couch,fkaempfer/couchdb,fkaempfer/couchdb,apache/couchdb-couch,fkaempfer/couchdb,fkaempfer/couchdb,ngpestelos/couchdb-couch,fkaempfer/couchdb,apache/couchdb-couch,KlausTrainer/couchdb-couch,smithsz/couchdb-couch,cloudant/couchdb-couch,cloudant/couchdb-couch,KlausTrainer/couchdb-couch,alanning/couchdb-couch,alanning/couchdb-couch,apache/couchdb-couch