On the structure of varieties with equationally definable principal congruences I