Make ::saveToFile use QSaveFile instead of homegrown solution.
Add licensing header.