Defects and nanocluster engineering in MgO