Controlled functionalization of the polysaccharide chitin