Travis CI: add test setup, tune tests to return proper exit codes