Merch.Race.Top.MapGen: Correct invocation of mgPutDistance.

  Previous version would assign distances from s1 to s2 to
   the distance between s2 and s2.
Merch.Race.MapGen.Measure: Optimize algorithm for measuring distances.
Merch.Race.MapGen.Measure: Correct distance generation in the presence of loops.