Added serilization to JSON using GSON and used it to implement persistant history. Saving takes longer than expected, so we'll definitly want to do this asyncronously with backups, or something.