Move shortPath() to artifacts.js