major refactor of file layouts and makefiles