in american history what was the purpose of the period known as reconstruction