Geometry of q-hypergeometric functions, quantum affine algebras and elliptic quantum groups