Spectral theory for slowly oscillating potentials I. Jacobi matrices