Merge Kurt's testing changes and fix broken tests

Merge in @kwmsmith 's changes to the Travis YAML file and to the Makefile.  This (the fact that we're running tests with `unittest discover` instead of `nosetests`) reveals some problems with existing tests, so fix those.

There is a bit of minor refactoring at the beginning of this PR---I didn't realize the merge was going to reveal problems as it did, so this PR is an unexpected detour.