Added permutations, hamming metric. Fixed bug with CosineDVectorMetric