publish dialog <=> editor title synchronization

This adds title synchronization between the publish dialog, and the code editor. If there is no `<title>`, or worse, no `<head>` element, this code will inject them to ensure the source code has a title element that can be synchronised..