Fourier-Mukai and autoduality for compactified Jacobians. I