Get rid of some code duplication and move the priority of the master

into make-servers rather then hardcoded in myconfig.js
Add a function to throw secondaries into maintenece mode
Fixed PHP-751: When a secondary goes into recovery mode, we should disconnect from it