MB-8746: Implementation of the spatial view initial index build

This commit adds the initial index build for the spatial views. It's the
same bottom-up approach as for the mapreduce views. They even share a lot
of code.

The records are first sorted based on a space filling curce (Z-order curve).
Then they are paritioned into equal chunks which form the leaf level. In the
future the partitioning will be optimized for faster querying.

Change-Id: I48cf797b407ae2ee902986b028eb7a35ff0eafdb
Reviewed-on: http://review.couchbase.org/39637
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>