Adjust to changes in mocha API

As of release 1.9.0, mocha does not check for global variable leaks by default,
so the '--ignore-leaks' option has been replaced with '--check-leaks'. This
breaks testing on fresh clones of the repo, as upstream mocha >= 1.9.0 just
fails instead of giving a deprecation warning.

We now fix a lower bound on the mocha version in 'devDependencies', with config
scripts modified to reflect the API change.