feat: save version number to config file.
refactor: Divide writing config file to opening and contents.