Update makefiles, clean up code and add some of the previous files