Restructure Makefile to add automated tests.