Dialog windows open conditionally

`core.js` is mostly clean of dialog things.