Étale and affine representations of Lie algebras and algebraic groups