Combining nitrogen substitutional defects and oxygen intercalation to control the graphene corrugation and doping level