Making makefile a bit nicer, moving some code around in xml.hpp to better organize it
more reorg/doc updates
mostly comment changes