Add travis file and improve code portability