Introduce unit tests

Fixes #8