Move modal positioning to js.

The pure css modal positioning causes rendering problems in IE9 that
occur if the modal has scrollable content.