Conway's game of life model using javascript and html5 canvas