Generate 3 binaries for server, client and standalone

Also try to modularize CMakeList.txt to keep it readable.

Note that maintaining a separate folder for tests makes that we must duplicate modules, or create a hard link in the cmake script. I chose to duplicate the modules.