Websocket reworked, and Sql partial integration

Also some minor change.
Added a config file for main-server