Refactor master & cluster logic plus util classes and config loader
Merge