Refactor codes
Move a mocha option to mocha.opts from package.json
Add some tests