MB-7013: Add support for multidimensional indexes/queries

You can now create and query multidimensional indexes. Those
indexes can contain a geometry, but don't need to. The only
difference is, that you now emit an array of ranges.

If you want to emit a geometry, then it needs to be the first
element in the array. An example would be:

    emit([{"type": "Point", coordinates: [0, 0]}, [100, 350]]);

This would build a 3-dimensional index, two dimensions for the
geometry, one for the second range. In case the additional ranges
are simply points (have no dimension), you can also emit a simple
value:

    emit([{"type": "Point", coordinates: [0, 0]}, 254]);

As mentioned before, you don't need to emit a geometry. But
make sure that all values you emit are numeric:

    emit([30, 40], 254, [0, 1], 9]);

To query this multidimensional index, two new parameters are
introduced: `start_range` and `end_range`. Both take an
array as input, the `start_range` contains the lower values,
the `end_range` the upper ones.

If you want to have an open range, just put in `null` as a value.
If `start_range` and `end_range` contains `null` for a certain
dimension, it's like a wildcard, it will match all values.

Example:

   <spatial-endpoint>>?start_range=[10,70,null]&end_range=[20,null,200]

Change-Id: I94661acc4b6638ef4306c5bb31a4cedf8104aa73
Reviewed-on: http://review.couchbase.org/25132
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>