Improved config system and added autosave on exit