MOTOR is defined as "a machine giving, imparting, or producing motion". This means the output of an electric motor is a mechanical force; the input is voltage.
GENERATOR is defined as "a machine for converting mechanical energy into electrical energy". This means the input of a generator is a mechanical force; the output is voltage.
The purpose of a commutator is to provide the switching action in the current waveform to allow the magnetic field developed by the rotor winding to "move" with respect to the stationary portion of the machine (i.e. the stator pole windings). In an AC machine, the cyclic nature of the sine wave form provides the necessary "movement".
One thing to remember is that there is always "the right tool for the job". If this was not the case, the only tool mankind would have would (probably) be a length of wood swung like a club. All types of electric machines (Direct Current, Alternating Current synchronous and asynchronous, permanent magnet, switched reluctance, linear, etc.). were designed for very specific tasks. Sure, there's some overlap in certain power / speed / torque ranges... but generally there is always a "best" solution that only fits one type of machine.
The limitations of the DC system however became more and more apparent as the power demand increased. In the case of DC systems the generating stations and the load centers have to be near to each other for efficient transmission of energy. The invention of induction machines in the 1880s tilted the scale in favor of AC systems mainly due to the advantage offered by transformers, which could step up or step down the AC voltage levels at constant power at extremely high efficiency. Thus AC system took over as the preferred system for the generation transmission and utilization of electrical energy. The DC system, however could not be obliterated due to the able support of batteries. Further, DC motors have excellent control characteristics. Even today the DC motor remains an industry standard as far as the control aspects are concerned. In the lower power levels and also in regenerative systems the DC machines still have a major say In spite of the apparent diversity in the characteristics, the underlying principles of both AC and DC machines are the same. They use the electromagnetic principles which can be further simplified at the low frequency levels at which these machines are used.
To be able to define the "right tool for the job" requires a thorough knowledge of ALL the tools... so that an informed choice can be made.