Refactor mapHelper.Line() and add tests for closestPointOnPolyline.