Which challenges and opportunities confronted Americans who settled in new states and territories after 1812?