Performance

Use Performance API if available + optimize astar.search by moving pathTo function outside