CR comments.

Moved loopback code to its own file, and only serve it when needed.
Log websocket and websocket server errors.