Make socket asynchronous again

You modified the code so that it does: open connection - send query - receive result - close connection. Websockets are by default asynchronous, there's no real reason to establish a new connection every time you want to do a new query. Originally I had the socket object stored globally, but there's no real reason to do that either. 

The change I made to the code just leaves the connection open, and sends and receives queries freely. It also makes the code much simpler to read, IMO. If you want to leave it the way it was that's fine since it does work, but dBc_ might get annoyed that you're creating a new connection message in his log every time you send a new query. I tested this so it should be fine.