Classification of nematic order in 2 + 1 dimensions: Dislocation melting andO(2)/ZNlattice gauge theory