Fixes to raw SSC mode, moved Dialog into edit.js