Refactoring and tests
Travis setup