Refactor Translator JS

Fix #23