Merge pathfinding to design branch

There are some other incomplete features included, but they shouldn't get in the way: they're still basically hidden.