Implements the BFS search for deadlocks. Fixes a horrible bug when player has multiple pushes in one location.