Simple js Class to save a JSON Object in a cookie