It works now, but I'm not sure yet if the rules are implemented correctly. To do: Clicking cells, faster rendering using canvas.