switched to coffeescript, rewrote sorting of search results