MB-8531: Implement initial index build

This is the Erlang side of the new C based initial index build

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