Add tests

Depends on #1.