Growth of MgTe and Cd1−xMgxTe thin films by molecular beam epitaxy