Implement a ZK master detector

Continuing the work @nekto0n did around implementing a ZK master detector here. I'm also going to do a few basic tests (and fix anything along the way) around ensuring the scheduler correctly tries to re-detect a master when it loses a connection to the current leader.