Main: implement canWin, canLose

Tighten up loops for searching through winning/winnable positions.