function routeScore(route) {
      if (route.score === undefined) {
         route.score = map.estimatedDistance(route.point, to) + route.length;
      }
      return route.score;
   }
A* search function.

This function expects a `Map` implementation and the origin and destination
points given. If there is a path between the two it will return the optimal
path as a linked list. If there is no path it will return null.

The linked list is in reverse order: the first item is the destination and
the path to the origin follows.

@param {Map} map map instance, must follow interface defined in {Map}
@param {Array} origin
@param {Array} destination
@param {Number} timeout milliseconds after which search should be canceled
@returns {Object} the linked list leading from `to` to `from` (sic!).