Homotopical Algebraic Geometry II: Geometric Stacks and Applications