Improve test infrastructure.

The latest `mocha` allows you to directly return a `Promise` from a
test case, eliminating the need to manually catch exceptions.

Improve the `package.json` to install mocha and run the tests with
`npm test`.

Add a `.travis.yml` to support continuous integration testing.
Merge pull request #38 from cscott/improve-tests

Improve test infrastructure.
Merge conflict corrected.