Improving directory structure.
Add Makefile, fix bugs in cpp files, fix bugs in py files.