Refactor reindexProjects in Init to be general
Refactor reindexProjects in Init to be general

Refactor reindexProjects method in Init to allow reindex for all
indexes rather than only for Projects.

This is especially useful for Elasticsearch since it allows us to
reindex all indexes before starting the site.

Change-Id: I17d532b1beac3465aac53fbda778e7838687511c
(cherry-picked from ec2884926984b9ddccd49f2f196c8c70009ac8b5)

GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit