unit test improvements
unit test improvements

- 'make check' in $(dir) will now run the tests in $(dir)/tests
- test rules now make sure to build the thing being tested

dkogan/buildsystem,dkogan/buildsystem