Changed most code to use settings from a configuration XML file