Added js-comint and refactor