added modularity extractor for random and infomap outputs