Prototype of phase2 in Louvain.

Refactoring is needed so it can run recursively to phase 1.