Merging from upstream
Adding comments, minor jslint cleanup and improvements for readability
Making debug logging more testable and adding tests
minor fix for coveralls
Adding remaining test coverage
Merge pull request #6 from pgoldrbx/master

Cleanup and test coverage