Bug fixes, improved routing

Fixed a bug that caused a crash related to the
8-outgoing-links-per-portal limit
Changed the routing algorithm from greedy time-minimization to
pseudo-branch-and-bound (much better)