change how shutdown is handled

Promises don't work properly with threads, so keep the server up in a loop

Because of this change the server will not kill the dispatcher after
Shutdown() is run so the client will now panic in the event that the server
is able to respond to the shutdown request (which should be impossible)
test daemon shutdown
improve rand test for those with chronic bad luck

Can still fail if the stars align but should be more unlikely