Replace magic constants with named constants in cm/config.py.
Reduce code duplication in test_master_instance.py.