Added PCA routines with unit tests.