Add Travis CI support

Includes lots of changes to deal with the ancient version of Ubuntu
that Travis uses.