Engineering the electronic properties of MoTe2 via defect control