MAINT: spatial.distance: further refactoring

* static on all functions in distance_impl.h
* commented out unused compute_mean_vector
* reindented code according to NumPy conventions
* removed some useless variables