Quantum mechanics of null polygonal Wilson loops