Light refactoring JS (edit.js) . closes #14