Fixed flipping problem, made more unittest, uniformise API - changed float* to Features for the first argument of function metric.dist