Why were the American Revolution and the War of 1812 similar?