Move modules to lib/ subfolder
Refactor peer discovery, fix #57
Code style