Allow controllers to disconnect without leaving their control behind.

- Create a socket disconnect callback to allow tear-down of a connection
- During tear down, remove any references to disconnected socket
- Move init and tear down into the .js code and out of the HTML.