Simple game of life in javascript canvas