Refactor dm parser to support Dissimilarity/DistanceMatrix classes