Formatting only - whitespace cleanup

Spaces only from now on, consistency FTW
Trailing whitespace killed

git diff --ignore-space-change is empty
Use a daemon thread for the event queue

We should not be starting threads which will hold the application open
Shutdown the event queue on disconnect

A new one will be spawned at reconnect
Thread death and event queue fixes

 * Track future timeouts so they can be cancelled, allowing the
   eventqueue to terminate in reasonable time
 * Synchronize lazily constructed singleton access