Change directory structure and refactor build process.