Fix tests

Fix most of the failing tests and add Travis configuration.