Use tap test runner

Fixes problem where the test process would fail but exit with zero.
Fix tests