Linearization of generalized interval exchange maps