Algebraic Geometry over Groups I. Algebraic Sets and Ideal Theory