Added testcase for client, some refactoring, added travis file