Refactor and optimize findRouteSegment

Backported from java.
There are differences managing the new calculated point.
See TODO on source code.
Calculate bearing for zero length segments.
Correctly manage start and end points.

Duplicate, modify and register new roads to add new points.
Postprocess start and end segments when over same road.
Manage added roads in loadRouteSegment and loadTileData.
Simplify exclusion of duplicates.
Save correct information for visited points.
Change conditions on old routing algorithm to check for solution.
Remove unnecesary conditions.
Simplify and refactor routing algorithm.
Other minor changes.
  * Reduce argument passing cost.
Change in funtion argument types to reduce runtime cost.
Adding 'const' to reduce unwanted change risk.
Only a trivial an uncomplete modification. We need better understanding
of code to establish clear interfaces. Also clarify lifetime and ownership
of dynamic storage.
  * Simple warnings elimination.