Refactor dashboard JS so links are generated by PHP instead of JS (for adding new links to Dashboard page) and move segment editor HTML generation to new class.