how do js constructors work?
WebSocketRealm (implements my rough idea of RelativeWebSocket but more cleanly: by defining a metaclass instead.)

I think this should work, but it's untested at the moment.