Add some unittests and support for travis-ci