Port cilantro/ui level CoffeeScript file to JavaScript

This does not need to be a closure.