adjust directory structure and make editor.js function closure