Faster because of inline calculations and precalculation of gen_dist_matrix

Normalization: Put into extra function. Default is now no normalization.
In comp_pers_cpt inline function implementations were used instead of
unique function.
Calculation of gen_dist_matrix now only done once