Rework test framework and enable `make check`