Structural and electronic properties of CdTe-based heterostructures