Refactored Coordinate methods and distance calculation. Fixed tests