Clean up code, add README and top-level Makefile.