Make location / distance generic.
Added benchmarks.