Fix #116 - JSONStore.save() shouldn't just try to overwrite the old file

	We use to just attempt to overwrite the new config over the old
	if the old config was longer than the new the end of the file would
	cause incorrect data.

	As a solution we now write to a temp file, delete the old config
	and move the temp file to the config path. This protects us from
	loosing data in the middle as it's atomic and prevents old data
	from being able to affect a newer version of the config.