How did the scientific revolution of the 17th and 18th centuries lead to change in the way people thought about society and government?