Add unit tests

fixes #4