The head of Facebook’s AI research is stepping into a new role as it shakes up management