Added function to save config. Closes #81.