'onStop' not declared locally, JSHint failing

I corrected some minor stylistic issues:

- 'onStop' was missing in the var statement, thus being declared globally
- JSHint was failing due to missing {} and ;
- the comment regarding opts.stop was wrong