Detecting complex network modularity by dynamical clustering