Add coverage to tests

This adds a coverage report to the tests. When run on Travis CI, it also sends the coverage report to Coverall.io, a free service for open source projects that shows a history of coverage and provides a badge.

Todo:
1. First go to https://coveralls.io/repos/new and turn on this repo (you may need to click to sync first).
2. The accept this PR (or if already accepted, trigger a new build).