Hypoellipticity and local solvability in Gevrey classes