Made shutdown procedure
ParseToDom can return empty document and this cause problems but now this is checked.
Made configuration class that loads in all configurations from a file
Extra test functions