Added xml file validation.
Added history/log save function.
Improved log save function. Added save progress and cancel functions.
Cleaned and refactored some code.