Using multiple tags to improve robustness. Added ability to launch replacement slaves. Refactored some code into helper functions.