Refactoring and adding basic travisCI support