Improved code documentation and flow.

- Correctly documented all modules and internal classes.
- Updated JSHint to not complain about valid `this` usage.
- Modified package.json to use ~ over ^.