MB-8531: Add initial spatial index building

This is already build to work with n dimensions.

Currently only the key-value sorting is implemented
in C. The actual tree building is still in Erlang.
Change-Id: I8edd00cfb5341907369b468da6a9aca4ed13c21c
Reviewed-on: http://review.couchbase.org/27196
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>