Add travis file and some modifications to index.js