Improvements to the permalinks UI

Closes #4454

* Relies on Flexbox more heavily
* Adds JS to simulate how it should work
Merge pull request #4469 from PaulAdamDavis/permalink-improvs

Improvements to the permalinks UI