Added Configuration code

Merged with upstream code and added code for loadConfig and saveConfig.