Move mocha to devDependencies and refactor tests