Γ-Convergence Analysis of a Generalized XY Model: Fractional Vortices and String Defects