devel: Renamed metric to distance function
devel: Extended templates to support different distance functions
fix: Exclude MPI if not found