Refactor Translator JS

Fix #23 

/cc @Stof