replaced killserver with faster shutdown over a websocket
abstract away DOM usage