In what ways did race, nation, and religion unify populations but also make societies more difficult to govern and economies more difficult to manage as the 19th century came to an end and the 20th century began?