Moduli of curves and spin structures via algebraic geometry