Adding initial version of PCA Distance code
Rename pca_distance internal functions to be consistent