Port "root" level coffeescript to JS

Progress towards #143.