Classification of evolutionary equations on the lattice. I. The general theory