Add A* pathfinding

It was really hard.