Monitoring elementary molecular events and conical intersections by ultrafast X-ray pulses, quantum light, and optical cavities