What were the main causes and consequences of the War of 1812?