simplify generator of index statements

Change-Id: Id5706eee41112ca688963f025e033811ffc6fe48
Reviewed-on: http://review.couchbase.org/36657
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>