Add travis file
Refactor main.py and add documentation