Changed slaveOkay to use read_preference, and added inheritance of preference in constructor