Mapping local Hamiltonians of fermions to local Hamiltonians of spins