Graph regularity and counting lemmas