[js] refactoring js, lang && templates