Plasma-materials interactions and impurity control in magnetically confined thermonuclear fusion machines