Refactor distance functions

Changed marks to no long fade in/out.
Broke the line drawing function out to a separate method.
Added a closure to calculate the distance to the player for arbitrary
units.
Merge pull request #1 from James226/master

Merging in upstream changes
Merge pull request #2 from orclev/master

Refactor distance functions