Add testing support

Implements #9.