Refactor lib files.
Refresh tests for lib/utils.
Add test .jshintrc file.
Switch tests to Mocha.