Remove consecutive spaces

This removes leading and trailing spaces from the server name and limits the number of consecutive spaces to one. Fixes #995.

Before:
<pre>
      !  T      E S  T !           
</pre>

After:
<pre>
! T E S T !
</pre>