Made AStar more generic.

Constructor takes in an adjacency list and the nodes are very basic with
only elements needed by the algorithm.