Refactor some code and improve redrawing

 * Add a .coffee file which must be compiled to .js