Tests

The actual test coverage is minimal, but I wanted to get the autotools stuff in, and other PRs also add tests
yeah you can strip out that HAVE_BLACKBOX crap