Ideology and algorithms: the uses of nationalism in the American Civil War and topic modelling in historical research