Tidy things up a bit, added cleanup config
Fixed some DOM mixups, added 'cleanup' config, more xml and xsd cleanup