FIX Using all and not just the first datapoint in gmean_cpd_score and perplexity_loss

 * Corrected indexing in gmean_cpd_score and perplexity_loss
 * Numerically more stable computation of gmean_cpd_score