Extracted and genralized WhitelistWatcher.

WhitelistWatcher can be used for tracking changes to all kind of
whitelists. In order to reuse the functionality, extract the code from
master sources.

Review: https://reviews.apache.org/r/28230