The geometry of the moduli space of curves and abelian varieties