made board state an atom
cleaned up win detection with tests