Mocha tests

Add the 'Mocha.js' test runner and convert all existing tests to that.

Also, re-structure the current tests into different files for testing the different functions.

Use `npm test` to call the test suite (after installing devDependencies using `npm install -d`)