finish coffeescript to javascript conversion, rewrite client as an angular module