Improve server running state handling

* Used threading.Event instead of boolean;
* Added wait server method to wait until server started.
Connect to broker on server start

Connection to broker is established at server start now,
not during server creation.