Game of Life implementation in JavaScript