Pathfinding Performance Improvements

Stop finding long, complex paths if enough simple paths are found.
Handle the last link in the path more efficiently.
Various cleanups, replacing BOOST_FOREACH with range-based for.