30225: Add stable sorting for panels, sections, controls in JS and improve in PHP

https://core.trac.wordpress.org/ticket/30225