Construct modals using D3 and bring back rounded corners in edit modals.

The `modal` function was overwriting the element's styles, removing our rounded corners. I also converted the rendering logic of non-editing modals to use D3 instead of HTML strings.