Semisimplicity and rigidity of the Kontsevich-Zorich cocycle