Implemented a graceful disconnect and did some UI clean up

@davidfowl @mikary @abnanda1 
declare a variable:

```Javascript
var worker = listOfWorkers[i];
```