MB-8531: Implement initial index build

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

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