Add dynamic master/slave selection so that I can run the server/listen on different machines