Run tests on Travis and fix some compatibility issues

Ack!