Add unit tests

Write some basic unit tests and integrate with TravisCI