cleanup, adding comments in code

- logging module was not used in widgets.js
- addins some comments to explain the code