Replaced unnecessary iterations through State.goals
Removed all use of dfs, repurposed dfs function into floodfill

Using floodfill to determine all positions a player can reach from a position to use in 'inHistory'