Add unit tests
Merge pull request #10 from rodo/master

Add unit tests for some functions