Changed typing in community-detection algorithms.

CommunitySet is now graph type-agnostic, as well as the algorithms that support both directed and undirected graphs. Typechecks have been added where necessary.
Also added unit tests for the community-detection algorithms.
Added Louvain community-detection algorithm.