Dialog improvements

The dialog.reposition(child) function, limit dialog x-size to window
width, leave 10 px margins, and use html() for MessageBox title and
message.