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