A modular paradigm for building self-organizing peer-to-peer applications