Updated tests
refactoring and cleanup
added travis config