refactoring and added more tests
added .travis.yml for CI