Integrate JS-refactoring of master-branch