Eliminated some global variables.  Using sockjs.