What attracted immigrants, farmers, and african americans to the cities of the northeast and midwest in the late 1800s and 1900?