Fix travis ci

Fix various issues that are preventing tests from running on travis-ci.

Python 3.* still don't pass, but those will be fixed by another PR.