Cellular Automata on HTML5 canvas