Reduce max number of numbers in the MBB to 16-bit

In order to make the on-disk file format of the spatial views more
along the lines of the mapreduce views, reduce the number of numbers
in the MBB from 32-bit to 16-bit.

Change-Id: Ia00f88df33d2ab1b1bd2f6f39348072f7d617f4e
Reviewed-on: http://review.couchbase.org/39633
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Make sort_spatial_kvs_file suitable as record file sorter

When building the intitial index, the records are written into a
single file that then gets sorted. This commit makes the
`sort_spatial_kvs_file` function comply to the API of the record
file sorted callback.

Change-Id: I6898db1eb05d108102858119a96f449d83ca0242
Reviewed-on: http://review.couchbase.org/39634
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Make it possible to unit test static functions

In order to be able to test static functions, use the `STATIC` macro
instead of `static`. This way the static will be removed when the file
is compiled for the testapp.

Change-Id: I6175e24c07494bbed0e8456ac857b4d91f5b0949
Reviewed-on: http://review.couchbase.org/39635
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Parse spatial view information

The supplied information for spatial views is different from the mapreduce
views. Insted of getting reduce functions, we receive the bounding box
that encloses the current view.

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