Controlled co-deposition of FePt nanoparticles embedded in MgO: a detailed investigation of structure and electronic and magnetic properties