Allow io to be injected

To allow our server architecture to be more flexible, we have added this change.
It allows us to create the server elsewhere and hook multiple websocket libraries to the same connection.