Quantum Fredkin and Toffoli gates on a versatile programmable silicon photonic chip