Rewrite update/draw function in coffee, segregate config