Factor out a method to trigger and wait for the couchdb view rebuild.
Add service command making sure that the couchdb views are indexed.