Clean up code. Add Makefile and some header files.