Update Makefile and dependencies.
Rename tests directory to test.
Reorganize tests.
Fix tests.