How did patterns of immigration to the united states change between the 1840's and the 1910's? what roles did newly arrived immigrants play in the economy during the late nineteenth and early twentieth centuries?