Js refactoring

Completely refactor JS using Backbone and CoffeeScript.
The main improvements are:

* Modularize code and make it reusable
* Fix scheduler to be usable with normal click event
* Fix some bug in WS update handling
* Move model processing to JS to keep a consistent API