Remove consecutive spaces in servername

This removes leading and trailing spaces from the server name and limits the number of consecutive spaces to one. Removing is done on both server- and clientside. I moved to code to clean the string to system.c. Fixes #995.

Before:
<pre>
      !  T      E S  T !           
</pre>

After:
<pre>
! T E S T !
</pre>