Polymerization, shock cooling, and the high-pressure phase diagram of nitrogen