Meta dist

This changes the distance policy implementation.
Some code duplication is removed.
Dot is computed with std function.
Some cpp tests are added for cartesian distance.
meta_per_dist is a bit confusingly named.  I think meta_periodic_distance  or meta_periodic_dist would be better