Minor refactoring

- Split off a "select" method so other functions can subselect with
indices without computing averages
Use set to speed up indexing
Fixed bug in handling integer indices
Minor updates to KMeans

- Added estimation of similarity to cluster centers
- Take random sample instead of take
Added class for generating example data sets

- Data generator for KMeans
- Data generator for PCA
Removed unnecessary method
Changed field name
Added awaitTermination for compatibility with 1.0