Geometric Langlands duality and representations of algebraic groups over commutative rings