t/: Migrate to BATS

Migrate all the tests to BATS, dropping the hand-rolled TAP-compatible
thing. The new system makes the tests much easier to understand and
maintain.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>