Unit tests

This should fix #21