Made dumping of distancematrix configurable
Merge branch 'master' into armadillo
Made matrix code more independent