Refactoring
Fix test
Fix typo, add extra assertions
JSDoc style comments
Merge pull request #1 from iloire/pull3

Looks good to me.