Moved XML loader to a module of its own. Replaced loader class with functions.