A spectroscopic and viscometric study of the metal ion-induced gelation of the biopolymer chitosan