The M23 armed group agreed a deal with SADC on the evacuation of its forces from the eastern Democratic Republic of Congo.