Fix the tests and setup travis

This fixes the test suite and lets us run them on travis.