improve websocket class

No longer exposes primitives, driver and socket, and instead delegates
desirable functionality.