Added unittests, remove global objects
added .travis.yml