A Prym construction for the cohomology of a cubic hypersurface. Local moduli and singularities. Appendix (by B. Martin and G. Pfister): An algorithm to compute the kernel of the Kodaira-Spencer map for an irreducible plane curve singularity 