Use js2-mode and js2-refactor