Refactored distance_xop into package
Cleaned up code formatting