JSHint Chat UI

- Refactor idle logic to changeIdle function
- Hoist to single 'i' declaration that was used in consecutive for loops
- Remove hanging comma
Remove empty JSHint directive
Fix JSHint directive
Merge pull request #794 from nschonni/fix-jshint-errors

Fix jshint errors