Reversi Game in Javascript using Canvas