Javascript implementation of classic minesweeper game