Issue #2191: Make tests work

Tests are currently broken: https://travis-ci.org/Freso/thebuggenie

The branch this pull request is based on will hopefully eventually make the tests pass, so Travis can be enabled for the main project. Please do look at [the test reports](https://travis-ci.org/Freso/thebuggenie) and the diffs and comment with suggestions for how to make progress.

I also hang out in #thebuggenie on IRC, so feel free to poke me there about it as well.

You can also make pull requests against the "make-tests-work" branch of my thebuggenie clone. (The one this pull request is sourced from.)

TBG issue: http://issues.thebuggenie.com/thebuggenie/issues/2191