astar: Make the heuristic function configurable when calling find.