Merge pull request #41 from One-com/feature/mocha

Rewrite tests to use mocha
add jshinting and solve problems