Javascript implementation of Game of life