JavaScript Sudoku solver