Vars variables and ensure it checks for leaks in mocha

There were two unvarred variables in the top of index.js. Also I added `--check-leaks` to package.json test declaration to ensure future unvarred variables are caught by the CI.