Build a tree structure for better path generation.
Needed a toString() method for State to get the alreadyVisited hash table working correctly.