Refactor code, add tests and CI
Update travis CI
Fix test Exception