Conway's game of life in JavaScript on the canvas