Introduce tests

While trying to make this whole thing more modular i also introduced
some tests. These are implemented using tap.