Refactor to use standard SocketServer RequestHandler design

See https://github.com/kanaka/websockify/issues/71.