Minesweeper in javascript