JS backend: refactor ClassTranslator
draft