Add retry mechanism, Some refactoring
Add Travis