Refactor and update JS/CoffeeScript.