Add support for initial whitelist.
Update master re-detection mechanism.
Add scenarios when master re-detection should run.
Watch whitelist more often in order  to reduce testing time.
Add tests.