What were the causes and effects of the war of 1812?