Add travis config

Also fixes some minor build and test issues that caused failures on Travis