Added config handling

Created a configuration class, and integrated with the existing classes.