cs-completer: improvements for solution detection

Second take on https://github.com/Valloric/YouCompleteMe/pull/886 .

I have ported the changes to the new ymcd-subrepo and merged them with the ones in the master branch there.  The detection of solutions is now in a separate ```solutiondetection``` module (feel free to rename it) as well, so in ```cs_completer.py``` the path for the solution to be loaded is retrieved through ```solutiondetection.Detect( request_data[ 'filepath' ] )```. I hope you had something like that in mind.
It isn't quite clear what this function does from the name (or even the code). Also,what is `preferred_name`? It isn't obvious to me, even after looking through the code a bit; this means the code needs to be more readable.