JSON.stringify() is too blunt an instrument. If you want something done right...