Refactore tests and travis configuration