Substitution reactions of galactomannans in organic media