refactoring on javascript core translations. add Math support