From a Feudal Electorate to Nation State: Secularization and Reformation in Bavaria, 1700-1825