radically change project structure, clean up main.c, add examples