Refactoring peer discovery

For now, this mainly fix #57 by implementing my suggestion for uniform peer handling across modules (by using events).

I also moved all sub-modules files from the root folder to `lib/` subfolder. Better distinction between readme/license files and code files.