Updated edit_session.js to make kitchen-sink work

this.$modes was used with [mode], which is an object, not a valid value, it should have been this.$modes[mode.$id], but in cases the mode doesn't have an $id, let's default to the common single value in this.$modes (Which is, as far as I know, "ace/mode/text"). In other lines, _self was being used out of context.