removed toJSON function since we're only using it for IE, which already has JSON.stringify.