Load settings from XML
Extensive commenting added