What shifted population from rural agrarian to urban industrial?

The invention of the cotton gin
The first textile mill
The introduction of new power sources
The increased use of slavery