Exploring the molecular basis for the metal-mediated assembly of alginate gels