Php warnings in Lda model

Added checks to avoid php warnings while training an Lda model
First commit in Clustering branch

Changes:
- Renamed SetDistance to Distance (backwards incompatible)
- Renamed SetSimilarity to Similarity (backwards incompatible)
- The above interfaces don't require arrays as arguments any
  more
- CosineSimilarity, JaccardIndex, Simhash don't require arrays
  as arguments any more

Additions:
- Similarity
  * Hamming distance
  * Euclidean distance
- Clustering
  * Centroid factory (a class to generate centroids from a set
    of documents)
  * Euclidean and Hamming centroid factories
  * Kmeans clusterer (with test)
Added a centroid factory for cosine similarity
BugFix hamming_centroid.php

Changed a count() to a strlen().
Testing code for clustering

The code that generates the images and the EuclideanPoint
document is gathered in a separate file for reuse.
Comment additions
Merge branch 'clustering'