Added new rules for Master selection

Added new rules for Master selection using replication tree