MB-8603: Refactor out capi_indexer

The capi_view and the upcoming capi_spatial share a lot of code,
hence the refactoring into a module that shares the common
functionality makes sense.

Change-Id: I1946527d1207b0a9cb27dd5136e9b07fcd8caf87
Reviewed-on: http://review.couchbase.org/27423
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>